How to modify the category base prefix in WordPress? Well there is a very easy way to change the category base prefix, but there is no real solution to completely remove this prefix.
In this article we will touch possible ways that will allow you to remove the category prefix entirely.
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!