How To Remove the Category From the WordPress URL

How To Remove the Category From the WordPress URL

What is WordPress? 5 reasons why it’s the best choice for website

What is WordPress? 5 reasons why it’s the best choice for website

April 14, 2026
BeTheme 2026 Review Beginner-Friendly or Agency Powerhouse

BeTheme 2026 Review: Beginner-Friendly or Agency Powerhouse

April 16, 2026
What is WordPress? 5 reasons why it’s the best choice for website

What is WordPress? 5 reasons why it’s the best choice for website

April 14, 2026
BeTheme 2026 Review Beginner-Friendly or Agency Powerhouse

BeTheme 2026 Review: Beginner-Friendly or Agency Powerhouse

April 16, 2026
 

That "/category/" sitting in your WordPress URL is doing nothing useful for you.

By default, WordPress adds it to every category archive URL. Most site owners leave it there without thinking twice.

But cleaner permalink structures reduce URL depth, improve readability, and make category archive pages easier to share. Knowing how to remove the category from the WordPress URL correctly, with proper 301 redirects and slug conflict checks, is what separates a clean migration from one that breaks rankings.

This guide covers every method: the native permalink settings workaround, Yoast SEO, Rank Math, and a custom code approach. Plus how to handle redirects, fix conflicts, and verify the change worked.

What Is the WordPress Category Base in a URL?

 

The WordPress category base is the prefix WordPress adds to every category archive URL by default. Out of the box, every category archive follows this pattern: domain.com/category/news/.

That "/category/" segment is the category base. WordPress writes it into the site's rewrite rules automatically, and it lives in the "Optional" section of Settings > Permalinks under "Category base."

Leave the field blank and WordPress defaults to "category." Fill it in with a custom word and it swaps the prefix. Remove the prefix entirely and the URL shortens to domain.com/news/.

URL Type Example Category Base Present
Default WordPress domain.com/category/news/ Yes (/category/)
Custom base domain.com/topics/news/ Yes (custom)
Base removed domain.com/news/ No

The category base exists for a specific technical reason. Without it, WordPress has no way to distinguish a category archive slug from a page or post slug when they share the same word.

WordPress generates the category base through its Rewrite API, not through a plugin or theme. It writes the resulting rewrite rules into the .htaccess file on Apache servers. On Nginx, those rules live in the server config and need manual updates.

Yoast SEO has over 450 million downloads and remains the most installed SEO plugin for WordPress (Digital Web Solutions, 2024). Most users encounter the category base setting for the first time through Yoast's Taxonomies panel.

Where the Category Base Field Lives

Go to Settings > Permalinks > Optional section. Two fields sit there: "Category base" and "Tag base." Both are blank by default, which WordPress internally reads as "category" and "tag."

Clearing the field and saving does not remove the prefix. It just restores the default. Removing the prefix requires either a specific plugin toggle or a code-level filter.

How WordPress Writes Rewrite Rules

When you save the Permalinks screen, WordPress calls flush_rewrite_rules(). This rebuilds the rewrite rule table stored in the WordPress options table under rewrite_rules.

On Apache, WordPress then writes those rules to .htaccess. On Nginx, no automatic write happens. A developer has to add the rewrite directives manually to the server block. This distinction matters when removing the category base on Nginx-hosted sites.

 

Why Does Removing the Category Slug from the URL Matter?

Clean URLs are easier to read, easier to share, and take up less space in SERPs. But there are concrete technical reasons to consider this change beyond aesthetics.

Backlinko's 2024 research found that shorter URLs tend to rank better in Google's top results. The relationship isn't causal, but shorter URLs correlate with content that has cleaner site architecture overall.

URL Depth and Crawl Budget

Botify's 2024 data shows that 40-50% of crawl budget is typically wasted on low-value pages, pagination, and duplicate content. Adding an unnecessary path segment like "/category/" pushes archive pages one level deeper, which affects how quickly Googlebot prioritizes them.

For large content sites publishing hundreds of category archives, this adds up. Google's own documentation states that URL depth affects crawl prioritization, especially on sites with tens of thousands of pages.

Screaming Frog's 2024 audit data shows 67% of websites have broken internal links. Sites that change permalink structures without 301 redirects make this problem worse immediately.

User Experience and Click-Through Rate

BrightEdge's 2024 research found that clean URL structures improve CTR by 25%, because users trust readable URLs more than strings with extra path segments or parameters.

A category URL showing domain.com/news/ in a SERP result reads more naturally than domain.com/category/news/. That extra word signals infrastructure to the reader rather than content.

News sites are the clearest example. When a category archive URL appears directly in search results as a source, removing the "/category/" prefix makes the URL look like a section of a real publication rather than a CMS taxonomy page.

 

What Are the Risks of Removing the Category Slug?

3 technical problems appear consistently when the category base is removed without preparation: slug conflicts, broken external links, and plugin compatibility failures.

Knowing these before making the change is what separates a clean migration from one that tanks rankings.

Slug Conflicts Between Categories and Pages

This is the most common failure point. If a category slug and a page slug are identical, removing the "/category/" prefix means both URLs resolve to the same path. WordPress gives priority to the category, so the page becomes invisible.

A real example: a site with a "Travel" category at domain.com/category/travel/ and a static "Travel" page at domain.com/travel/. Remove the category base and both fight for domain.com/travel/. The page loses.

Conflict Type What Breaks Fix
Category vs. Page Page becomes inaccessible Rename page or category slug
Category vs. Post Post becomes inaccessible Rename post or category slug
Category vs. Tag Tag archive URL collision Rename tag or category slug

Any category archive URL already indexed by Google, linked to from external sites, or hardcoded in internal content becomes a 404 the moment the category base is removed without redirects.

Screaming Frog's 2024 findings show that 4xx errors affect 18% of all crawled pages on average across sites. Adding more 404s through a permalink change compounds an existing problem.

A 301 redirect passes the majority of link equity from the old URL to the new one. Without it, any backlinks pointing to the old /category/ URL structure stop passing value entirely.

Caching and Plugin Compatibility Issues

Caching plugins like WP Rocket and W3 Total Cache store static versions of URLs. After a permalink change, cached versions of old category URLs continue to serve the old path until the cache is cleared.

Some themes also hardcode category URL structures in navigation menus, breadcrumbs, or widget areas. These don't update automatically when rewrite rules change. They need manual correction or a database find-and-replace.

 

How to Remove the Category Base in WordPress Without a Plugin

WordPress has a native option for changing the category base, but fully removing it through the Permalinks settings alone does not work on standard installs. Saving a blank "Category base" field just restores the default "/category/" prefix.

The native method that actually works involves replacing the value with a period (full stop). This is a known workaround that tricks the rewrite rules into generating URLs without the category segment.

Navigate to Settings > Permalinks > Optional section. In the "Category base" field, type a single period: .

Click "Save Changes." WordPress writes updated rewrite rules into .htaccess on Apache. On Nginx, you need to update the server block manually with the new rewrite directives.

After saving, go back to Settings > Permalinks and click "Save Changes" a second time. This flushes the rewrite rules twice, which ensures the new rules register correctly in the WordPress options table.

Visit a category archive URL directly in the browser and confirm the "/category/" prefix is gone. If the page returns a 404, the rewrite rules did not flush correctly. Save the Permalinks screen one more time.

What Happens to .htaccess After Saving

WordPress rewrites the .htaccess file between the # BEGIN WordPress and # END WordPress comment markers. The category rewrite rule changes from matching /category/([^/]+) to a shorter pattern that matches the slug directly.

Do not manually edit the rules inside those markers. WordPress overwrites them on the next permalink flush. Any custom rules need to go outside the WordPress comment block.

On Nginx, there is no .htaccess. The server config needs a rewrite directive added to handle the new category URL pattern. Without it, Nginx returns 404 for all category archive pages after the base is removed.

How to Remove the Category Base Using Yoast SEO

 

Yoast SEO's strip category base toggle is the most widely used method. It handles the rewrite rules at the PHP level, which means it works on both Apache and Nginx without server config changes.

Yoast SEO has over 450 million downloads (Digital Web Solutions, 2024) and its category prefix removal option is available in the free version.

Finding the Setting in Yoast

Go to SEO > Search Appearance > Taxonomies tab. Scroll to the Categories section. At the bottom of that section, find the toggle labeled "Remove the categories prefix" and enable it.

Save the changes. Yoast rebuilds its own rewrite rules on save, separate from the WordPress core rewrite table. This is why the setting works on Nginx. Yoast manages the URL rewrites in PHP before the server routing layer handles them.

What Yoast Does to Sitemaps and Redirects

Sitemaps update automatically. Yoast regenerates the XML sitemap to reflect the new URL structure immediately after the setting is saved. Old /category/ URLs no longer appear in the sitemap.

Yoast version 21.9 introduced an optimized sitemap rewrite mechanism. Rewrite rules now only clear when the "strip category base" option actually changes, not on every settings save. This reduces unnecessary rewrite flushes across the site (Yoast, January 2024).

One known limitation: Yoast's support documentation notes that switching this setting back off after enabling it can produce 404 errors if rewrite rules don't regenerate correctly. Test on a staging environment before enabling on a live site with indexed category URLs.

I'm interrupting the article to tell you about BeTheme, the definitive multipurpose theme. If trying to satisfy multiple clients has become more stressful than rewarding, BeTheme has a solution for that.

BeTheme’s selection of hundreds of customizable, responsive pre-built websites is the highlight and a proven stress reducer.

The customizability of the theme makes it a dream come true for its users. There are 4 types of Page Builders that you can use with it: WPBakery, BeBuilder, and Elementor among them.

And now with the Live Builder, it’s even more impressive.

Check out BeTheme and see why our users love it!

The rest of the article is down below.

 

How to Remove the Category Base Using Rank Math

Rank Math handles category base removal through its General Settings panel. The toggle is called "Strip Category Base" and it functions similarly to Yoast's option, but with one notable difference. Rank Math's Redirections module handles old URL forwarding automatically when active.

Enabling Strip Category Base in Rank Math

Go to Rank Math SEO > General Settings > Links tab. Find the "Strip Category Base" toggle and enable it.

If the Links tab is not visible, the plugin is running in Simple Mode. Switch to Advanced Mode under the Rank Math dashboard to expose the full settings panel.

After enabling, Rank Math automatically redirects existing category URLs to the new shorter structure. Per Rank Math's own documentation, if a 404 error appears after enabling the option, go to Settings > Permalinks and click "Save Changes" to flush the rewrite rules manually.

How Rank Math Handles Redirects vs. Yoast

This is where the 2 plugins differ in practice. Rank Math's Redirections module logs every automatic redirect it creates and lets you edit, disable, or delete individual rules from Rank Math SEO > Redirections.

Yoast does not provide a redirect log for the category base change. It handles the rewrite at the PHP routing level, which means you cannot see or modify individual redirect rules through the plugin UI.

For sites where the category archive has significant backlinks or existing SERP presence, Rank Math's approach gives more control over verifying that old URLs forward correctly.

 

How to Remove the Category Base with a Code Snippet

The code method works for developers who don't use Yoast or Rank Math, or who want the logic in version-controlled theme or plugin code rather than a plugin setting.

The WordPress Rewrite API's add_filter( 'category_link', ... ) hook is the right place to strip the category base from generated URLs. Do not edit functions.php directly in a parent theme. Use a child theme's functions.php or a code snippets plugin like WPCode.

The Filter and What It Does

Add this to your child theme's functions.php or a WPCode snippet:

add_filter( 'category_link', 'remove_category_base', 10, 2 );
function remove_category_base( $link, $category_id ) {
return str_replace( '/category/', '/', $link );
}

This filter intercepts the URL WordPress generates for every category link and strips the "/category/" segment before output. It does not update the rewrite rules, so it handles the output side but not the server routing side.

Flushing Rewrite Rules Programmatically

After adding the filter, the rewrite rules need to be flushed once to register the new category URL pattern with WordPress. Add this to the same snippet, but only run it once:

add_action( 'init', function() {
flush_rewrite_rules();
}, 20 );

Remove that flush call after the first page load. Calling flush_rewrite_rules() on every request is expensive and slows the site down noticeably.

Adding Redirects Alongside the Code Method

The code filter does not create 301 redirects for old /category/ URLs. Those need to be handled separately.

The Redirection plugin by John Godley handles this well. Create a regex redirect rule matching /category/(.*) and pointing to /$1. This catches any old category URL that still has the prefix and forwards it to the correct clean URL.

An Apache .htaccess rule works too, placed outside the WordPress comment markers:

RedirectMatch 301 ^/category/(.*)$ /$1

Either approach covers the redirect side. The code filter handles URL generation. Together they replicate what Yoast and Rank Math do through their plugin settings.

How to Set Up 301 Redirects After Removing the Category Base

Removing the category base without redirects turns every indexed category archive URL into a 404. That breaks backlinks, kills crawl continuity, and wastes the link equity those URLs accumulated.

A properly implemented 301 redirect preserves 90-99% of link equity from the original URL (JEMSU, 2024). Google's Gary Illyes confirmed in 2016 that 30x redirects no longer lose PageRank, and John Mueller reinforced in 2022 that 301s act as canonical signals consolidating authority to the destination URL.

Redirect Method Best For Handles Automatically
Rank Math Redirections module Most WordPress sites Yes, with redirect log
Redirection plugin Sites without Rank Math Yes, with 404 logging
Apache .htaccess rule Developers, high-traffic sites No, manual setup required
Yoast rewrite layer Yoast users Yes, no log available

The Apache .htaccess Redirect Rule

Place this rule outside the WordPress comment markers in .htaccess, above the # BEGIN WordPress block:

RedirectMatch 301 ^/category/(.*)$ /$1

This single rule catches any URL still containing "/category/" and permanently forwards it to the slug-only version. Test it with a browser developer tools network tab or a redirect checker tool after adding it.

Chain redirects carry a real cost. A Moz case study found that each redirect hop causes a 15% drop in organic traffic passing through it. Keep the redirect path direct: old /category/ URL to new clean URL, one hop only.

Using the Redirection Plugin for Non-Yoast and Non-Rank Math Sites

The Redirection plugin by John Godley logs every 404 the moment it occurs. This makes it especially useful for catching any category URL patterns you missed during setup.

After installing Redirection, go to Tools > Redirection > Add New Redirect. Set the source URL to /category/(.*), enable regex matching, and set the target URL to /$1. Set the HTTP code to 301.

The 404 tab in Redirection logs real-time broken URL hits. Check it 24-48 hours after making the category base change to catch any category URL patterns that the main redirect rule did not cover.

How to Test Redirects Before and After

Screaming Frog SEO Spider's list mode handles redirect verification well. Upload a CSV of old /category/ URLs, enable "Always Follow Redirects" under Configuration, and run the crawl. Any URL not returning a 301 chain ending in a 200 needs attention.

Free browser-based tools like Redirect Checker (redirectchecker.org) handle individual URL tests. Paste the old category URL and confirm the response chain shows 301 to the new clean URL, not a 302 or a chain of multiple hops.

 

How to Resolve Slug Conflicts After Removing the Category Base

Slug conflicts are the most disruptive failure point in this entire process. When a category slug and a page or post slug are identical, WordPress gives the category priority and the other content becomes unreachable.

The conflict does not throw an error. WordPress quietly loads the category archive and the page or post simply stops appearing anywhere. No 404, no warning. That makes it tricky to catch without deliberate checking.

Identifying Conflicts Before Making the Change

Export all slugs first. Use WP All Export to pull a CSV of every post, page, and category slug. Sort both lists alphabetically and look for matches.

  • Check posts against categories
  • Check pages against categories
  • Check custom post type slugs against categories
  • Check tag slugs if tag base is also being removed

Any slug appearing in both lists is a conflict waiting to happen. Resolve it before touching the permalink settings.

Fixing a Live Conflict

Screaming Frog 2024 data shows it can identify over 300 SEO issues and warnings in a single crawl. Running a full crawl after the category base change surfaces any pages suddenly returning unexpected content or going missing from the link graph.

2 fixes work:

  • Rename the category slug under Posts > Categories > Edit. Pick a slug that doesn't clash with any existing page or post.
  • Rename the page or post slug in the document settings panel in the block editor, then set up a 301 redirect from the old page URL to the new one.

After renaming, flush rewrite rules by saving the Permalinks screen. Then crawl the affected URLs again to confirm the correct content loads at each path.

The rewrite rules handle how WordPress routes incoming requests. They do not retroactively fix hardcoded /category/ URLs already embedded in post content, navigation menus, widget areas, or theme templates.

Better Search Replace has a dry-run function that shows exactly how many database entries contain the search string before any changes are made. Always run the dry run first.

Running Better Search Replace on the Database

Go to Tools > Better Search Replace. In the "Search for" field enter /category/. In the "Replace with" field enter /.

Select all relevant database tables. At minimum, select wp_posts (post content and GUIDs), wp_postmeta, and wp_options. Click "Run as dry run" first to see the count. Then disable dry run and run the actual replacement.

Back up the database before running the live replacement. Better Search Replace handles serialized data correctly, but a backup before any database-level operation is non-negotiable.

Navigation menus in WordPress store URLs as absolute paths in the wp_posts table under the nav_menu_item post type. Better Search Replace catches these if you select all tables. But verify manually afterward.

Go to Appearance > Menus and check any menu item pointing to a category archive. Menus that were built by selecting "Categories" from the left panel update automatically when the category URL changes. Menus with manually pasted URLs do not.

Yoast and Rank Math both regenerate their XML sitemaps automatically when the strip category base setting is saved. If you used the native WordPress method or the code snippet method, regenerate the sitemap manually and resubmit it via Google Search Console > Sitemaps.

How to Test That the Category Base Was Removed Correctly

Testing is where most people skip steps and pay for it later in Google Search Console. Run all 4 checks below before considering the migration complete.

Browser and Redirect Verification

Direct browser test: visit a category archive URL with the old /category/ prefix. It should 301 redirect to the clean slug URL automatically. If it returns a 404, the redirect rule is missing or the rewrite rules did not flush.

Open Chrome DevTools > Network tab > Preserve log enabled. Load the old URL. Confirm the first response is a 301, not a 302 or 200. A 200 on the old URL means the redirect is not in place.

Screaming Frog Crawl Check

Run Screaming Frog on the full site after the change. Filter the Internal tab by "Contains" and search for /category/. Any internal links still containing that pattern need to be updated in the database or template files.

  • Response codes tab: confirm no 404s on category archive URLs
  • Redirects tab: confirm all /category/ URLs show 301 chains ending in 200
  • Sitemaps tab (if connected to Google Search Console): confirm no /category/ URLs appear in the XML sitemap

Google Search Console Coverage Report

After 48-72 hours, open Google Search Console > Pages > Not found (404). Any old /category/ URLs appearing there means Googlebot hit them before the redirect was in place, or the redirect is not working for the bot's crawl pattern.

Request re-indexing for the 3-5 most important category archive URLs directly in Search Console using the URL Inspection tool. This speeds up Google's recognition of the new clean permalink structure and clears cached versions of the old URLs from the index.

Submit the updated XML sitemap under Search Console > Sitemaps. This signals to Google that the site structure has changed and prompts a re-crawl of the affected category archive URLs on the new clean paths.

FAQ on How To Remove The Category From The WordPress URL

Does removing the category base improve SEO?

Not directly. Shorter URLs improve readability and reduce URL depth, which affects crawl efficiency on large sites. The SEO risk comes from the migration itself, not the shorter permalink structure. Always set up 301 redirects before considering any ranking impact.

Will removing the category slug break my site?

It can, if you skip redirects or have slug conflicts between category and page URLs. WordPress gives categories priority when slugs match, making affected pages unreachable. Test on a staging environment first.

What is the easiest way to remove the category prefix?

Using Yoast SEO or Rank Math is the most straightforward method. Both plugins handle the rewrite rules at the PHP level and work on Apache and Nginx. No server config changes needed.

Do I need to flush rewrite rules after the change?

Yes. Go to Settings > Permalinks and click "Save Changes" after any category base modification. Do it twice to ensure WordPress registers the updated rewrite rules correctly in the options table.

What happens to old category URLs after I remove the base?

They return 404 errors unless you set up redirects. Any indexed URL containing "/category/" stops working immediately. Use a 301 redirect from the old pattern to the new slug-only URL to preserve link equity and user access.

Can I remove the category base without a plugin?

Yes. Enter a period in the Category base field under Settings > Permalinks. This is a known workaround that strips the prefix through WordPress rewrite rules. On Nginx, you still need to update server config manually.

What causes a 404 after removing the category slug?

Usually unflushed rewrite rules or a missing redirect. Go to Settings > Permalinks and save twice. If the 404 persists, check the .htaccess file on Apache or verify server block rewrite rules on Nginx.

How do I fix a slug conflict between a category and a page?

Rename either the category slug or the page slug so they no longer match. WordPress cannot differentiate identical slugs without the "/category/" prefix. After renaming, flush permalinks and set up a 301 redirect from the old page URL.

Does Rank Math handle redirects automatically when stripping the category base?

Yes, when the Redirections module is active. Rank Math logs every automatic redirect it creates under Rank Math SEO > Redirections. This gives more visibility than Yoast, which handles rewrites at the PHP level without a redirect log.

How do I verify the category base was removed correctly?

Visit an old /category/ URL and confirm it 301 redirects to the clean slug URL. Run Screaming Frog to filter internal links still containing "/category/". Check Google Search Console's Pages report for 404 errors 48 hours after the change.

Conclusion

This conclusion is for an article presenting every practical method to strip the category base from WordPress permalink structures, from the native settings workaround to Yoast SEO, Rank Math, and custom code filters.

The technical steps are straightforward. What trips people up is the cleanup: flushing rewrite rules, resolving slug conflicts, and updating hardcoded internal links in the database with Better Search Replace.

Skip the 301 redirects and you lose whatever link equity those category archive URLs built up. That part is non-negotiable.

Run Screaming Frog after the change. Check Google Search Console's coverage report after 48 hours. Verify the XML sitemap reflects the new clean URL structure before calling it done.

Albert Ślusarczyk

Albert Ślusarczyk

As the co-creator of Be Theme, I am a strong believer in designing with care and patience. I pour my energy, time & knowledge into perfecting the theme for our 260,000+ customers.
Buy now 700+website templates