DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Ever wanted to be able to finally remove the useless /category/ from your WordPress categories permalinks? If yes, read on and get ready to hack your .htaccess file!

By default, WordPress category permalinks are displayed that way:


As you can see, the category in the url is pretty useless. Here’s how to remove it:

First backup your .htaccess file. Then, open it and append the following line:

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

Once saved, your categories pages will be displayed like this:


Better, isn’t it?


  1. This can be done as:

    RewriteRule ^category/(.+)$ /$1 [R=301,L]

    This is without ‘http://www.yourblog.com’ – useful if you are switching between local/staging/production environments. Although it doesn’t work on some server setups.

  2. It doesn’t work with subcategories. I have custom subcat pages on my theme. When i use this Rewrite Rule my subcats pages goes to 404.php :(

  3. like @Daniel said doesn’t work on subcategories.
    so what we can do?

  4. Just add the plugin WP No Category Base and everything will be ok!
    Don’t need to mess with the .htaccess file!

  5. Yes, Tiago that’s was the best option. But out of curiosity where is that hard coded in WordPress. I always prefer to modify the wp files than to use the plug-ins.

    Had a quick look in to wp-includes/link-template.php

    Will go through again once got some extra time.

  6. As of WordPress 3.1.2, but I suppose even for previous versions, this is article is a no no from the start down to the previous comment.

    First, *appending* the rewrite rule will never work since the previous ones as they are written will not allow to be executed, ever.

    Second, the url structure example.com/ is assumed here to work out of the box, but simple it does not.

    Third, @nSathees, the editing of the WordPress core files is a no no and no one will advise you to do so. Plugin, or at least the well programmed ones, are the way to go because they ensure optimal management and consistency.

    Fourth, there is no way to do the /category/ removal with an .htaccess solution. A plugin is required.

  7. This solution break the pagination. Doesn’t work.

  8. Hey every, after reading through these comments I decided to go down the route of installing a plugin after my attempts with the 301 redirect turned out to be useless.

    WP No Category Base – WPML compatible – this is the plugin I’ve installed to remove the /category/ slug from my urls. If you’d like, head over to my site and check out the plugin live.

    To avoid this looking like spam I’m assuring you the plugin will work – there’s no need unless you want to double check to head over to my blog.

  9. The wordpress plugin that Jesse recommended worked for me! WP No Category Base – WPML compatible

    Thanks for the share!

  10. WP No Category Base plugin is a great replacement for the .htaccess trick. Thanks.

  11. Thanks for suggesting WP No Category Base – WPML. It did just the trick on my WP Multi-site install. Make sure you Network Activate it when you do install it!

  12. I had problems with the Top Level Categories plugin, it broke my category links, so I switched to the No Category Base plugin and this works much better

  13. I don’t like to install a plugin for everything also. I just wish there is a good solution for this annoying thing, I really do not see why WordPress keeps pushing this “feature”.

  14. Easiest Solution here is a plugin to remove category base



  15. You guys weren’t kidding about the WP no category base plugin. Installing and activating it were a snap. And it works!

  16. thanks for sharing a great trick but unfortunately it does not work :(

  17. Unfortunately it’s not working for my site.:(

  18. I tried this method and got a little success but unfortunately found a bug when try to open sub categories it gives 404 Error. Any suggestion.

  19. You can also do this easily with the plugin “WordPress SEO” by Yoast (under Permalinks section of that plugin).

  20. If u use Yoast Seo Plugin in the Permalinks category u have a option : Strip the category base (usually /category/) from the category URL,check and have fun :)

  21. I have been looking into a few options here for this and just installed the wordpres plugin: http://wordpress.org/extend/plugins/no-category-parents/
    which seems to be updated and highly download, so seems to work fine.

    only thing i noticed that the old links are still accessible, i’m guessing i should 301 them.. next :-)

  22. Yoast does not work at this moment. Selecting categories with subcategories will return a 400 …

  23. I’ve put this in on my site. Would this affect visitors from the search engine? I mean, the url changes right? I dont want my visitors to suddenly find 404 on my site and I’m sure Google does not like it either.

  24. is not working :(

  25. About that plugin, when installed the existing pages all have error page not found. Sound great when even all redirects take care of. Anyone idea of other plugin to remove the category sludge? Thanks!

  26. Thank you for the information tiago(commentor). But i used WP No Category Base – WPML compatible plugin and it changes my categories permalinks from http://website/category/blog to http://website/blog

    Its easy and plugin will do all the work.

  27. tnx . i have problem with www. and no www link .

    with www. this snippets work well but in no www url dont work .

  28. This is a hacky way to do it, plus it is confusing for some bloggers as they are not used to regualr expressions. You shouldn’t be twiddling with other software levels than wordpress. You will end up with a spagetti software stack. Everything undre your /blog directory is handled by your blog software in this case WordPress. Have a look at this good practice way to do it:

    Anyways thanks for your post.

  29. WP No Category Base works. Thanks for sharing!

  30. Or you could just install this plug-in, which does the job for you:


  31. The “WordPress SEO” plugin by Yoast is perfect. Just remember to flush your permalinks.

  32. Agree with Kory, Yoast’s SEO plugin has an option to strip the category.

  33. Easy decision.
    On the left side choose SEO/permalinks
    and select Strip the category base (usually /category/) from the category URL.
    Thats all.
    It helped to me, becides seo by yoast and all in one seo are magnates of wordpress seo plugins.

  34. Nice tip, was looking for this, thanks!

  35. @Sean, thanks for the tip. I am using Yoast plugin but didn’t noticed that option before you mentioned it.

  36. This worked for me initally but after I created sub categories it broke the pagination.

  37. Yoast Seo Plugin works great for that ! just click one button. Thank you Sean !

  38. how I can hide this www. part from browser?

  39. This seems like it should be good for SEO, but can anyone confirm this. The /category/ doesn’t go away, it is just redirected?

  40. Settings > Permalinks > Common Settings > Custom Structure = /%category%/%postname%/


  41. Oh but it doesn’t remove it from the category url when you display it in your wp_menu… My bad !

  42. And then in “Optionnal” don’t forget to fill the field “Category Base” with “.” that remove the “/category/” from the url…

    Sorry about that triple message !

  43. Thanks to this posts i tried wp-no-category-base and it worked like a charm. Thanks!

  44. Believe me, No body cares..Hows your category URL looks like !…Not even Search Engines!!

    Still many popular blogs are still using default “category” or “tag” slug :)

    Its just about our mind problem to change and feel good.
    And as comments by few people got 404 or server errors and lost visitors to the website. So don’t put your lovely website on plugin authors hands because If they discontinue update the plugins or you move your host, You may lose traffic to your website for sure because of errors.

    Better not to use Plugins. If you really wanna short or change slugs, Change only from default Settings>>Permalinks>>Caregory base.

    Be Secure, Worry Free & Serve without Errors. Cheers

  45. Naomi Kyoto

    This is the only plugin that has dealt with all the corner cases I’ve experienced trying to remove ‘/category’ from the URL. https://wordpress.org/plugins/remove-category-url/

    Best of luck surviving through whatever your next wordpress nightmare might be.

Leave a Comment

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