HomeTipsChange Wordpress Category Base With 301 Redirection

Change WordPress Category Base With 301 Redirection

Carrying on from my previous article about changing permalink structure for individual posts, I also decided to optimizes category base as well. Before writing this article, TechVorm had the default category base string i.e “/category/”. I changed it to a better looking, shorter version viz. “/cat/”, It’s shorter by 5 characters and makes the url length relatively small. Win-win situation!

On a side note, just to share it with you, this was more of a personal preference rather than a tweak for Search Engine Optimization (SEO). Anyhow, let’s carry on with steps to do so. I am listing down the steps I followed to change wordpress category base as well as set proper search engine friendly 301 redirection:

  1. Install Redirection Plugin from wordpress repository.
  2. Activate the plugin.
  3. Under Tools -> Redirection, you’ll get access to Redirection settings, open it.
  4. Enter the following values:
    1. Source URL – “/category/(.*)”
    2. Target URL – “http://www.techvorm.com/cat/$1” (input your own url instead of techvorm.com)
    3. Check the “Regular expression” option (since we are using one!)
  5. Now simply click on “Add Redirection” button and we are ready to make the transformation.

Change WordPress Category Base Slug

This was about preparing Redirection Plugin to handle 301 redirects (Permanent Redirects). Now we need to change the category slug in wordpress installation. In case you are not aware of the steps, continue reading:

  1. Go to Settings -> Permalinks
  2. Under “Optional” head, change “Category base” to ‘cat’
  3. Click on “Save Changes”.

That’s it! You are now good to go. Flush the cache before testing the working of all links. With this you’ll not be losing the link value of existing URL’s (preserving SEO value); traffic from search engines or getting 404 error pages.


Please enter your comment!
Please enter your name here

Recent Articles