Do you want to change the category base prefix in WordPress?
By default, WordPress automatically adds /category/ as a prefix to URLs for all category pages. However, you can easily change the base category prefix or remove it altogether.
In this article, we will show you how to change the category base prefix in WordPress.
What is the category base prefix? Should it be changed?
Each category on your WordPress site has its own page and RSS feed. You can view all posts filed in a category by visiting that category’s archive page.
By default, WordPress adds “category” as a base prefix to category page URLs. This helps differentiate pages and posts from category and tag archives.
For example, if you have a category called “News”, its URL would look like this:
Similarly, WordPress also adds tag prefixes to URLs for tag archives.
This SEO-friendly URL structure helps users and search engines understand the type of page they are visiting.
Most websites don’t need to change the base prefix at all. However, if you are building a niche site where you want to use a different word or phrase for your categories, you can change the category base prefix to reflect that.
Changing Category Base Prefix in WordPress
Changing the base category prefix is quite simple in WordPress.
You must visit the Settings » Permalinks your WordPress dashboard page and scroll down to the “Optional” section.
In the “Category base” field, you can enter the prefix you want to use next to the category base option. You can also change the base tag prefix if you want.
For example, you can add “subjects” as a new prefix. In this case, your category URLs will look like this:
Don’t forget to click the “Save Changes” button to save your settings.
Removal of base category prefix from URLs
Many of our users have asked us to completely remove the category base prefix from WordPress URLs. This will change your category URLs to look like this:
This is not a good idea and we recommend that you do not remove the category base prefix.
The category base prefix helps both 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 WordPress SEO.
You may also experience 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 the URL structure for single posts, your site will experience an infinite redirect loop, causing pages to fail to load.
However, if you still want to do it, you can use the All-in-one SEO (AIOSEO) connect.
It is the best SEO plugin for WordPress and it is very easy to optimize your website for search engines. Moreover, it gives you the option to remove the category base prefix with one click.
For this tutorial, we will use the AIOSEO Pro License as it includes the feature to remove category base and other powerful options like redirect manager and link helper. There is also a free version of AIOSEO that you can use.
First, you will need to install and activate the AIOSEO plugin. For more details, please see our guide on how to install a WordPress plugin.
Upon activation, you will see the AIOSEO setup wizard. Just click the “Let’s Get Started” button. You can check out our guide on setting up All in One SEO for WordPress for more information.
Then you can head to All-in-One SEO Research » Appearance from your WordPress admin panel and click on the ‘Taxonomies’ tab.
After that, go to the Categories section and switch to the “Advanced” tab. From there, just click the toggle on Yes for the “Remove category base prefix” option.
Don’t forget to click the “Save Changes” button when you’re done.
Configuring redirects after changing the category base prefix
If you change or remove the category base prefix on a new WordPress website, you don’t need to do anything. However, if you do this on an existing website, users visiting the old category page will see a 404 error.
To fix this, you’ll need to set up a redirect to ensure that search engines and regular visitors are correctly redirected to the correct category page on your site.
The easiest way to configure redirection in WordPress is to use the All-in-one SEO (AIOSEO) connect.
To get started, you can go to All-in-one SEO » Redirects from the WordPress admin panel, then click the “Enable redirects” button.
Once enabled, you can navigate to the “Redirects” tab to configure the redirect.
Simply enter the URL you want to redirect in the “Source URL” field and the new link location in the “Target URL” field.
As for the redirect type, you can select “301 Moved Permanently” from the drop-down menu. This will permanently move your old category pages to the new destination.
Don’t forget to click the “Add redirect” button when you’re done.
For more details, please see our beginner’s guide to creating 301 redirects in WordPress.
Now all your users and search engines will be redirected to the correct URLs using your new category prefix.
We hope this article helped you learn how to change category base prefix in WordPress. You might also want to check out our list of most wanted WordPress tips, tricks and hacks and how to start an online store.