It is actually really easy to remove the category prefix from a WordPress post URL. There are 3 methods available that I’m aware of.
Method One: WordPress SEO by Yoast
If you are one of the 1 million+ installs using the WordPress SEO by Yoast plugin, there is an option to do this within the plugin settings.
- In the admin menu visiting SEO » Advanced
- Click the “Permalinks” tab
- Check the first option at the top of the page that says “Strip the category base (usually /category/) from the category URL.
- That’s it!
You will notice that they have a recommendation beneath the checkbox for FV Top Level Categories, which is our second method.
Method Two: FV Top Level Categories
If you aren’t using the WordPress SEO by Yoast plugin, this is the next best thing. However, the plugin authors for FV Top Level Categories give a word of caution:
“This plugin works also if you have a permalink structure like %postname% or %category%/%postname% — this wasn’t possible in the original version. However, this feature might not work properly for child categories at this point. Test carefully!”
Method Three: Add a Period as the Category base value
I found this trick at WPMU Dev. To accomplish this:
- Visit Settings Permalinks
- Click on “Custom Structure” and set your permalink structure to/%category%/%postname%/
- Lastly add a period as the Category base value (under Optional).
Note that this is probably more in the “hack” category as I’m sure this is not officially supported by WordPress and may not even work in the future. Use at your own risk!
Method Four (new): Remove Category Base (Free Plugin on WP Repo)
This is an option I’ve added to the list. Remove Category Base is a free plugin that completely disables the category base from all URLs generated by WordPress so that there is no category slug displayed on archive permalinks. It also tackles 301 redirects for proper SEO and usability which is important!
Thank you! Very helpful article. 🙂
Glad I could help Lily!
Ishtiak Ahmed says
This is really great!
I was using ‘dot’ method which caused 404 error in category pages. But now, with the help of your post, I have successfully removed /category/ from URL making no error.
Awesome Ishtiak, glad I could help!
Thanks for running a great site. Very informative.
I used the recommendation you mentioned on how to remove category , it works great!
But ever since my URL name is changed for category now when i go to http://cloudvedas.com/openstack/feed i am getting “Page not found” error . While the feed is still at http://cloudvedas.com/category/openstack/feed . How can i correct this? This is causing error for google crawler also and showing in my google search console URL error report. As crawler is trying the find the feed at http://cloudvedas.com/openstack/feed .
I can’t be sure what is happening without digging deeper into your theme / plugin setup. I would say, try resetting your permalinks but since you have already made a change to that page, I’m guessing this is not the fix.
Hello Mr. Jordan please try ours:
Because, Yoast is maybe heavy for simple task. Thanks bro…
I prefer Yoast for this as I already use that as my SEO solution for all of my clients and it’s a solid SEO plugin for most WordPress site owners, however, I do agree that if not using Yoast, a simple plugin solution would be a more efficient way to tackle this. I’ll add your plugin to the list of options in the article. 🙂