How to Change the WordPress Category Base Prefix without Losing Traffic
Do you want to change the WordPress category base prefix without affecting the SEO? If you are looking for a step-by-step guide to complete the task, keep reading this article! Here, we will show you how to change the WordPress category base prefix without losing traffic.
Categories and tags in WordPress are so helpful. By properly using them, you can keep your content well-organized. Since WordPress has this feature inbuilt, we do not need to use any third-party code or plugins to deal with categories and tags.
But is there any way to tweak them further?
There is!
With minimal effort, you could modify the WordPress category base prefix and change it to your liking.
And that’s what we will talk about in this article. Here, we will show you how to change the WordPress category base prefix in WordPress or WooCommerce without losing traffic.
Before going further, let’s see what the base prefix is.
What Is Category Base Prefix
As we mentioned initially, categories can be helpful for every WordPress and WooCommerce store. And you can create them manually right through the WordPress dashboard.
For example, here are some of the categories created with WordPress with the default base prefix:
- https://www.example.com/category/news
- https://www.example.com/category/music
- https://www.example.com/category/videos
WordPress will automatically add /category/ between your domain and category names. It is a part of the permalink structure and is known as the category base prefix. So when you or your website visitors land on the category archive pages, WordPress will use the configured prefix in the archive page URL.
Most people would be okay with the default base prefix, whereas some prefer tweaking it and ensuring it aligns perfectly with their branding.
You can also delete the category prefix from your WordPress/WooCommerce installation.
Now, you know what’s the category base prefix. The following section will explain why changing them is a good idea.
Why Changing Them Is a Good Idea
The main advantage of changing them would be to increase your user experience.
For example, let’s say you are running a website listing news about the latest games and everything around gaming. If you have created three categories (Racing, Action, Survival) through the editor, their URL will look like this:
- https://www.example.com/category/racing
- https://www.example.com/category/action
- https://www.example.com/category/survival
This is pretty basic and doesn’t fit well with your brand. To make things better, you could tweak the category base prefix and turn it to:
- https://www.example.com/genre/racing
- https://www.example.com/genre/action
- https://www.example.com/genre/survival
Instead of the game category, the game genre sounds more exciting and professional. Your users will love the changes, and you could rank your category archive pages better in search engine result pages.
Hence, changing the category base prefix would be a good idea.
Next, let’s move to the article’s core, where you’ll learn how to change the WordPress category base prefix.
How to Change WordPress Category Base Prefix
This section will show you how to change the WordPress category prefix correctly. The first thing you need to do is log in to your WordPress admin dashboard.
Once you have landed there, open the permalink settings. The permalink settings can be found under the WordPress settings section.
The permalink settings contain options such as:
- Default post’s permalink structure
- Category prefix structure
- Tag prefix structure
Since we focus on tweaking the category base prefix, you need to check out the Optional configuration settings.
There, enter your category base in the box and save the changes. In this case, we have created three categories. With the default base prefix, they look like this:
- https://www.example.com/category/games
- https://www.example.com/category/movies
- https://www.example.com/category/dramas
We will be configuring the base prefix to /topics/ to reflect our brand better. So, in the box, we will enter topics and save the changes.
Once you have changed the prefix, the old archive page URLs won’t work anymore. You can verify the changes by visiting the updated URL.
In the address bar, you will see the configured base prefix!
That’s it!
This way, you could tweak the base prefix of category archive pages and modify them according to your preferences. As you can see, you do not need to use third-party tools to tweak the URL structure.
How to Modify WooCommerce Product Category Base Prefix
Look into the product category prefix if you use WooCommerce to sell your products. By default, WooCommerce will use /product-category/ as the prefix. From the permalink settings, you can change it.
As we did before, enter the prefix in the box and update the changes.
After saving the changes, the new prefix will be used for your product category archive pages.
How to Remove WordPress Category Base Prefix Completely
Instead of modifying the default category URL structure to something else, you can altogether remove it from your website. This section will show you how to do it.
You can complete the task in 2 ways.
- Manually
- With Rank Math
Let’s take a look at both methods.
Manual Method
From the Permalinks settings, you could remove the category prefix. If you leave it blank, WordPress will use the /category/ prefix by default.
To get rid of the prefix, add a dot (.) in the box and update the settings.
You can check your category archive pages to double-check the modification.
This way, you can strip the category base URL manually.
NOTE: We do not recommend removing category base prefixes from your WordPress installation completely.
Rank Math Method
If you already use Rank Math to optimize your SEO efforts, you could use the same plugin to strip the category base. You do not need to install/activate any other modules. The configuration comes with the plugin itself.
To complete the process, go to the General Settings > Links. There, you could see an option called Strip Category Base. By default, the choice would be disabled.
To remove the prefix from the category URLs, enable the option and save the changes.
This way, you could use Rank Math to remove the category base prefix from the WordPress installation.
How to Set Up Redirections Properly
Above, we have shown you how to tweak/remove the WordPress category base prefixes properly.
If you have performed the task on a live WordPress website where the category pages are already ranked in search engine result pages, the next thing you need to do is set up redirections.
In simple words, you need to redirect the old category archive page URL to a new one so visitors won’t see a 404 error in the front end.
To configure redirections, we will be using Rank Math. If you are not using the tool yet, follow our guide, where we teach you how to install and activate the plugin correctly.
Once you have activated and configured the plugin, you must activate the Redirections module.
After activating the module, you can see settings under Rank Math options.
Next, click on Add New to add a new redirection.
Now, you can see the redirection manager.
The main configuration options available are:
- Source URL
- Destination URL
- Redirection Type
- Maintenance Code
- Status
In a nutshell, you need to enter the old URL in the source URL field and the new URL in the destination URL field.
Here, in this case, we will enter our old category URLs in the source field and new ones in the destination field. We also recommend using 301 redirections for the task.
After completing the process, you can view all the redirections under the Rank Math redirection manager settings.
This way, you can configure 301, 302, and 307 redirections with Rank Math. Apart from categories, you can also set up posts/pages or custom post-type redirections with the plugin. There won’t be any limitations.
You can also check the 404 error monitor to view all the URLs returning a page not found error.
Conclusion
When you run a WordPress website or WooCommerce store, you should focus on improving the user experience. If you think tweaking the WordPress category base prefix will help you get a better user experience, you should try it.
As you can see in this tutorial, you can modify the base prefix from your WordPress dashboard without using third-party tools or services. It gives you complete control, and you can change the prefix any way you need.
Also, if you already published some categories and need to tweak them, setting up redirections is a good way. This way, your website visitors won’t see a 404 page when they visit the old category archive pages.
With a plugin like Rank Math, creating redirections in WordPress would be a cakewalk.
We hope you have found this article useful and enjoyed reading it. Please share this post with your friends and fellow bloggers if you do.
It will help someone tweak the base prefix of the category correctly.
Which prefix are you going to use?
Let us know in the comments!