Remove Category Base in WordPress

Here’s how to remove your category base in WordPress:

About Jean Galea

Jean Galea is a WordPress developer, entrepreneur and padel player. He is the founder of WP Mayor, the plugins WP RSS Aggregator and EDD Bookings, as well as the Mastermind.fm podcast. His personal blog can be found at jeangalea.com.

Related Articles

  • How to Remove Image Sizes in WordPress

    In an earlier post about image sizes in WordPress, we had shown you a way to choose which image sizes are available for choosing when you're inserting an image in…

  • How To Hide or Remove Categories from a WordPress Homepage

    When displaying your latest posts on the homepage, you might want to exclude some categories from displaying on this page. There are many reasons why you would want to do…

  • WordPress Means Freedom

    As a WordPress user, you get four core freedoms due to the open source nature of WordPress’ software license. These WordPress freedoms are in contrast to closed-source desktop software like…

10 Responses

  1. Mir
    Mir June 22, 2011 at 03:22 | | Reply

    Where do we add this code? Also, any chance of making this a plugin?

  2. Edgars
    Edgars July 7, 2011 at 04:33 | | Reply

    Great tutorial, however to make sure everything works, htaccess and category.php files must be modified as well

    htaccess, need to add:
    RedirectMatch 301 ^/category/(.+)$ http://www.yoursite.com/$1
    # OR
    RewriteRule ^category/(.+)$ http://www.yoursite.com/$1 [R=301,L]

    category:
    default title must be replaced with:
    <a href="http://www.yoursite.com//“>

  3. Matthew
    Matthew July 28, 2011 at 13:53 | | Reply

    Nice job, it works fine. Thanks

  4. schools training
    schools training February 15, 2012 at 22:36 | | Reply

    It code is not working with sub categories , I just tried it on my blog. Please suggest

  5. Ivica
    Ivica June 26, 2012 at 18:27 | | Reply

    With new Yoast WordPress SEO you can now do it just with choosing an option in settings 🙂

  6. Joseph
    Joseph April 12, 2013 at 22:41 | | Reply

    Good post and comments
    If I use WordPress SEO, what happens to backlinks that contain the category base already? Will people be still redirected to the same post with new URL structure? 10x for your reply

  7. Chang
    Chang October 10, 2018 at 12:19 | | Reply

    Okay and why don’t make it be plugin like other??

    https://wordpress.org/plugins/remove-category-base-littlebizzy/

    code is same?? not bloated?

Leave a Reply