Do you want to change the base category prefix in WordPress? By default, WordPress automatically adds /category/ as a prefix to URLs for all category pages. In this article, we will show you how to change the category base prefix in WordPress. We'll also talk about whether or not you should remove the base prefix altogether.
Each category on your WordPress site gets its own page and RSS feed. You can view all archived posts in a category by visiting that category's archive page.
By default, WordPress adds "category" as a base prefix to URLs for category pages. This helps differentiate pages and posts from the category and tag archives.
For example, if you have a category called 'News', your URL will look like this:
http://example.com/category/news/
Similarly, WordPress also adds a tag prefix to URLs for tag files.
http://example.com/tag/iphone/
This SEO friendly URL structure helps users and search engines understand what type of page they are visiting.
Most websites do not need to change the base prefix at all. However, if you are creating a niche site where you would like to use a different word or phrase for your categories, then you can change the category base prefix to reflect that.
Changing the category base prefix is quite simple in WordPress.
You have to visit Settings »Permalinks page and scroll down to the 'Optional' section.
Here you can enter the prefix you want to use next to the category base option. You can also change the tag base prefix if you want.
Don't forget to click the Save Changes button to store your settings.
If you're changing the category base prefix on a new website, then you don't need to do anything. However, if you're doing this on an existing website, users who visit the old category page will see a 404 error.
To fix this problem, you'll need to set up redirection to ensure that both search engines and regular visitors are correctly redirected to the correct category page on your site.
You will first need to install and activate the redirect plugin. For more details, check out our step-by-step guide on how to install a WordPress plugin.
Upon activation, you need to visit Tools »Redirection page to configure redirection.
Scroll down to the 'Add New Redirect' section.
First, you need to add /categoría/(.*)
in the Source URL field. After that, you need to check the box next to the regular expression option.
In the Destination URL field, you need to add your new category base prefix like this / temas / $ 1
. Don't forget to replace the themes with your new category prefix.
Click the 'Add Redirect' button to save your changes.
That is all. Now all your users and search engines will be redirected to the correct URLs using your new category prefix.
Many of our users have asked us about completely removing the category base prefix from WordPress URLs. This will change your category URLs to look like this:
http://example.com/news/
This is not a good idea, and we recommend that you do not remove the base category prefix.
The category base prefix helps users and search engines distinguish between posts/pages and categories. Removing the prefix makes your URLs ambiguous, which is not good for user experience or SEO.
You may also have technical issues with various WordPress plugins. For example, if you have a category and a page with the same name or when you use %postname% as your URL structure for individual posts, your site will experience an infinite redirect loop causing the pages to never load.
However, if you still want to do this, then you need to install and activate the FV Top Level Categories plugin. For more details, check out our step-by-step guide on how to install a WordPress plugin.
The plugin works out of the box and will immediately remove the category base prefix from your category URLs.
We hope this article helped you learn how to change the base category prefix in WordPress. You may also want to see our list of the most wanted WordPress tips, tricks, and hacks.
If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Facebook.