WordPress by default adds the
/category/ slug in single category archive URL. Though that doesn’t harm, but definitely looks ugly if your category is a deep sub-category. WordPress by default provides option to change the slug, but not to remove them entirely. Here in this tutorial, we will show you how to remove WordPress category slug from URL.
Change Category Slug
If you have a niche blog, then you might want to change the slug rather than removing it entirely. Go to Settings > Permalinks in WordPress dashboard and type in a new Category base in Optional settings field. You can also change/modify the Tag base from there.
Remove WordPress Category Slug
For a better URL setup and SEO friendly URLs, you might want to remove the slug from the URLs. If you prefer using plugins than creating your own code, we suggest two plugins for that. Remove Category URL and Yoast SEO. You can use either of them.
Removing category slug using Remove Category URL
This is a standalone plugin to remove the category base from category URLs. This plugin requires no configuration, just install and forget. We suggest this plugin over others because it 301 redirects the old category permalinks to the new one and compatible with all the Sitemap Plugins.
Removing category slug using Yoast SEO
We are sure you have heard of this plugin and may be used sometime on your blog to optimize it. Apart from the awesome SEO features, this plugin lets you tweak some of the advanced settings of your blog and removing category slug is one of them. If you have this plugin installed, just go to SEO > Advanced from WordPress dashboard then click on the Permalinks tab.
Toggle the switch to Disable in Strip the category base (usually /category/) from the category URL option (the very first setting on the page) and click on save changes button. Yoast SEO will take care of the old permalink redirection and will generate a new sitemap with new URLs if you are using the Sitemap feature.