How to Change the Category Base Prefix in WordPress

How to change Category base prefix in WordPress

Are you willing to change the category base prefix in WordPress? WordPress uses the default link structure for categories on your website. The link looks something like this: domain.tld/category/category-name. Here, category is the base prefix for the link.  However, you can always change the category base prefix in WordPress and in this article, we’re going to show you how you can easily do that.

But before we begin, here’s a short description for those who don’t know about the category base prefix and if you should change it.

What is Category Base Prefix and Should You Change It?

Every category on your website has its own page and RSS feed. You can view all the posts that are situated under a certain category by visiting the archive page of that category.

WordPress adds ‘category’ as a base prefix to URLs for category pages by default. It helps to differentiate pages and posts from category and tag archives.

For example, if you have a category called “Tutorials” then its URL will look like this:

This SEO friendly URL structure helps users and search engines to understand what kind of the page they are visiting.

Not every website needs to change the base prefix. 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.

Having said that, let’s see how you can change category base prefix in WordPress.

How to Change Category Base Prefix in WordPress?

It is quite simple in WordPress to change category base prefix. First, you need to visit the settings page in your WordPress dashboard. Go to Settings > Permalinks page and scroll down to the Optional section.

Permalink page in WordPress.

Here you can enter the prefix that you would like to use next to the category base option. You can also change the tag base prefix if you want.

Click on the Save Changes button to store your settings.

Setting up Redirects after Changing Category Base Prefix

If you are changing the category base prefix on a new website, then you don’t need to do anything. But, if you are doing it in an existing website, then your users will see a 404 server error while visiting the old category page.

So, in order to redirect your visitors to the new category page, you will need to setup redirect and make sure both search engines and regular visitors are properly redirected to the correct category page on your site.

First, you need to install and activate the Redirection plugin. After activation, go to Tools > Redirection page to set up a redirect.

Scroll down to “Add new Redirection” section.

Add new redirection page in WordPress

Now, 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, add your new category base prefix /topics/$1. Don’t forget to replace topics with your new category prefix.

Now, click on the Add Redirection button to save your changes. That’s it, you have successfully redirected all your visitors and search engines to the correct URLs using your new category prefix.

Well, that’s all there is. Did this short tutorial help you change category base prefix in WordPress? Let us know through the comments section.


Source: WP Beginner

3 thoughts on “How to Change the Category Base Prefix in WordPress

  1. vitor wellichan says:

    in the tutorial there was a blank space in the string “/category/ (.*)”
    should be “/category/(.*)”



Leave a Reply

Your email address will not be published. Required fields are marked *