How to Remove /category/ from your WordPress URL

You’ve coded your menus and you’ve optimized the titles for SEO, but when you click on your menus, they return www.samplesite.com/category/keyword. For some that might work, but you might want to remove the /category/ so the final link is just www.samplesite.com/keyword.

There are a couple of strategies that may allow you to do this.

What worked for me was a simple trick in the Permalinks Menu:

  1. Go to: Settings -> Permalinks.
  2. Select ‘Custom Structure’ and in the box, type ‘/%category%/%postname%/’
  3. In the Optional section, put a ./ in the Category base box.

Custom Structure

Note that the above options will may not work if you are using sub-categories. We’ve found a work-around for this, which is to use ‘/%category%/%postname%.html’ as the custom structure.

Alternate options include using a plug-in, such as WP No Category Base.

You can also take a more technical route by modifying the .htaccess file (if you have server access.) I’ve heard mixed reviews as to whether or not this works, so attempt at your own risk. This method involves adding the following code to the end of your .htaccess file (making sure to back it up before making any changes – of course.)

RewriteRule ^category/(.+)$ http://www.yourblog.com/$1 [R=301,L]

2 Comments to “How to Remove /category/ from your WordPress URL”

  1. GRP Roofing says:

    Hi, I tried out your suggestion but found that the rss feed for each category was taking me to a 404 page. Any ideas on how to get arround this?

    Thanks
    Ryan

    • Creative Patience says:

      Just tested on our site and the RSS feeds for the categories are working. What’s the URL you are using for the feed?

Leave a Comment