How to remove Category Base WordPress

Developing a site with WordPress I needed to delete the Category base from the URL.

By default WordPress adds category to the categories.

http://php.quicoto.com/category/wordpress/

I was Googling arround and I found two solutions.

A. Code Solution

Add this line to your .htaccess file (in your root WordPress installation folder)

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

B. Plugin Solution

You can use this plugin wich does not require any kind of coding or set up.

WP No Category Base

The plugin requires no setup or modifying core wordpress files and will not break any links. It will also take care of redirecting your old category links to the new ones.

Download it from: http://wordpress.org/extend/plugins/wp-no-category-base/

Tags:

9 Responses to “How to remove Category Base WordPress”

  1. JMLeon April 27, 2010 at 4:57 pm #

    Actually the plugin breaks one link: The category feed link, it doesn’t work, so you’ll have to use both solutions at the same time.

    • quicoto April 27, 2010 at 4:59 pm #

      Oh really? :?

      I’ll make testing and I’ll edit the post with it.

      Thanks JMLeon ;)

  2. quicoto April 28, 2010 at 9:31 am #

    JMLeon I tested the Category Feed and it works for me without the .htaccess code.

    It was in a local install using Outlook 2007 feed reader. Both feeds worked.

    http://domain.com/category/XXXX/feed/
    http://domain.com/XXXX/feed/

    Maybe I should do the test online :?

    Regards.

    • JMLeon April 28, 2010 at 10:17 am #

      I found problems and had to write by hand every feed that wordpress created, don’t know if it’s a problem of the theme b/c it was not a new one and I found some very weird things on it.

  3. Renji September 9, 2011 at 10:09 am #

    Code Solution is not working for me. That just redirects to a post or returns a 404 if nothing is found.

    Plugin Solution did it!

    • Rick September 9, 2011 at 10:12 am #

      One way or the other, glad it worked !

  4. schools training February 15, 2012 at 10:07 pm #

    I tried using WP No Category Base on my website but it didn’t work because it’s removing subdomains as well. Is there are other way to remove category_base?

  5. Henry May 10, 2012 at 4:09 pm #

    Would removing the category base cause a URL conflict? How would WP know if the item is a category or a page or a post?

    • Rick May 10, 2012 at 4:13 pm #

      The the Plugin should work just fine.

      However I’d always recommend using /category/ in the URL.

      It’s more SEO friendly and easier for the user!

      Cheers

Leave a Reply

Add <code> Some Code </code> by using this tags.