I collect content without permission for WP Struggles*. Please visit the original sites, especially to share and comment.
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. In this article, we will show you how to change the category base prefix in WordPress. We will also talk about whether or not you should remove the base prefix altogether.
What is Category Base Prefix? Should You Change It?
By default, WordPress adds ‘category’ as base prefix to URLs for category pages. This helps differentiate pages and posts from category and tag archives.
For example, if you have a category called ‘News’ then its URL will look like this:
Similarly, WordPress also adds tag prefix to URLs for tag archives.
This SEO friendly URL structure helps users and search engines understand what kind of page they are visiting.
Most websites don’t 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 Category Base Prefix in WordPress
Changing category base prefix is quite simple in WordPress.
You need to visit Settings » Permalinks page and scroll down to the ‘Optional’ section.
Here you can enter the prefix you would like to use next to the category base option. You can also change the tag base prefix if you want.
Don’t forget to click on the save changes button to store your settings.
Setting up Redirects After Changing Category Base Prefix
If you are changing category base prefix on a new website, then you don’t need to do anything. However, if you are doing this on an existing website, then users visiting the old category page will see a 404 error.
To fix this, you will need to setup redirect to make sure both search engines and regular visitors are properly redirected to the correct category page on your site.
Upon activation, you need to visit Tools » Redirection page to setup redirect.
Scroll down to ‘Add new redirection’ section.
First, you need to add
/category/(.*) in the source URL field. After that you need to check the box next to the regular expression option.
In the target URL field, you need to add your new category base prefix like this
/topics/$1. Don’t forget to replace topics with your new category prefix.
Click on the ‘Add Redirection’ button to save your changes.
That’s all. Now all your users and search engines will be redirected to the correct URLs using your new category prefix.
Removing The Category Base Prefix in WordPress
Many of our users have asked us about removing the category base prefix from WordPress URLs altogether. This will change your category URLs to look like this:
This is not a good idea, and we recommend that you do not remove category base prefix.
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 SEO.
You may also run into technical issues with various WordPress plugins. For example, if you have a category and a page with the same name or when you are using %postname% as your URL structure for single posts, then your site will experience infinite redirect loop causing the pages to never load.
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 category base prefix in WordPress. You may also want to see our list of most wanted WordPress tips, tricks, and hacks.
Please visit, share, and comment at the source, not this site.
*My WP sites serve as my reference collections and notes for everything I do or have interest in for my use only. I use copied content on this MultiSite network toni-two.com and my ESL MultiSite at toni-esl.com.