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!