How to remove the CATEGORY base from WordPress URLs

You’ve probably noticed that WordPress automatically adds the /category/ prefix to the URL of any category archive.

While that structure is logical and descriptive, it may not be optimal from an SEO perspective. In fact, if you prefer to customize your category pages to perform more like hub pages, it’s probably better to remove the /category/ slug altogether.

So that your archive URL goes from:

domain.com/category/category-name

to:

domain.com/category-name

Recommended Method: I prefer to use a plugin to strip the category base because it avoids the issues that can pop up with other methods.

PS: The period as category base method should probably be avoided altogether.

Why remove the category base?

There are several reasons to remove the /category/ slug from your URL structure in WordPress.

These are the most common:

  1. Cleaner URL structure: Shorter URLs are user-friendly, SEO-friendly and mimic the structure of more modern CMS’s used by major brands.
  2. Hub Pages / Silos (SEO): Use an important keyword as the page slug instead of /category/keyword for better CTR’s and increased relevance.
  3. Disguise WordPress: Make it less obvious to visitors that your site is running WordPress (by changing the defaults)

Methods to remove /category/ from your URLs

WordPress is incredibly flexible and there are many different ways to achieve the same result. Each has it’s own advantages and drawbacks.

These are the methods I recommend considering, as well as one (popular) method that you should probably never use.

Methods to strip /category/ from URL:

  1. Use a Plugin (best method, free & easy)
  2. Rewrite rules in .htaccess (minimalist)
  3. Use a period ( . ) as the category base (worst option)

1. Use a plugin to remove /category/

This is my preferred method for several reasons:

  1. It’s easy
  2. You’re unlikely to break anything

Best of all, you might already be using one of the plugins that make this possible, meaning you won’t have to install another one.

Plugins to remove category from WordPress URLs

  1. Yoast SEO (free)
  2. Rankmath (free)
  3. No Category Base (free)

Yoast SEO: Remove the category prefix

  1. Install Yoast SEO
  2. Go to Dashboard > Yoast SEO > Search Appearance
  3. Click the Taxonomies Tab
  4. Under Category URLs (bottom) select Remove category prefix
3. Navigate to the Yoast SEO > Search Appearance > Taxonomies
4. Remove category prefix

Rankmath: Strip Category Base

  1. Install Rankmath
  2. Go to Dashboard > Rankmath > General Settings > Links
  3. Enable the strip category base option

No Category Base (WPML)

No Category Base is a super-light plugin that does exactly what the name says. It removes the category base from category archive URLs. Your permalinks for single posts will be exactly the same.

There are no settings. Simply install & active.

2. Use .htaccess to rewrite category URLs

This method is slightly more advanced because it requires editing your .htaccess file (Apache servers only). However this method is a great minimalist option, requiring no php or plugins.

Just add this to your .htaccess file (make sure to save a backup first)

RewriteEngine On RewriteBase / RewriteRule ^category/(.+)$ http://mydomain.com/$1 [R=301,L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
Code language: JavaScript (javascript)

Learn more: How to add rewrite rules to WordPress

3. Hack: Set Category base to period (don’t use!)

I’ve seen this method recommended all over the web. At least a dozen sites and multiple stackechange threads suggest it.

I’ve even used it myself on one site. And then I discovered the drawbacks!

Trust me. You do not want to use this method.

How it works

This hack is really simple to implement, and it does remove the /category/ base from your category URLs. Well, at least your top-level categories (more on that in a bit).

Use a period as the category base (WordPress permalink structure)

How to do it:

  1. Go to Settings > Permalinks > Category base
  2. Set the category base to a single period ( . )
  3. Click save changes

The problem: it breaks stuff

This method seems great, until you start noticing the things that break. There are a lot of issues, and they can have serious SEO consequences

What breaks?

  1. Sub-category 404 Error: Top-level categories work fine, but all subcategories will result in a 404 error unless you create a page with the same URL to replace it. This is impractical on large sites.
  2. Category Pagination: If your archive uses pagination and has too many articles to fit on one page, all paginated pages result in a 404 error. This can prevent important content from being indexed. Not good.
  3. RSS Feed: This one may fly under the radar, but your RSS feed breaks too.

Bottom Line: This method has few (if any) valid uses and there are too many downsides that outweigh the simplicity. Avoid at all costs!

Next Steps

Regardless of which method you choose, make sure to thoroughly test your site to make sure there are no 404 errors or unexpected behavior.

Once that’s done, you can focus on how to maximize the SEO impact of your new URL structure. Here are a few suggestions:

What to do next:

  1. Build Custom Category pages – Go after short-tail keywords with an optimized pillar post or hub page.
  2. Silo Structure – Punch above your domain authority by organizing your content into silos or topic clusters for a better UX. Use custom category pages (above) as the hub page for each cluster.

2 thoughts on “How to remove the CATEGORY base from WordPress URLs”

  1. Using any of these method breaks the page design of those pages which are using elementor, Not sure it bug in elementor or why it breaks.

    More and more clients want to remove category from permalink and removing this from elementor based pages such as News, Blogs breaks the page design as it refers to default template Hello Template for these page not the one created using Elementor Pro

    Reply
    • Elementor Pro archive templates work perfectly for me before and after removing the category base. If you’re talking about one of the methods where you replace an archive with a page, then yes you need to manually set the page template to full-width to override your theme’s default container.

      Reply

Leave a Comment