Ways to remove “/category/” from wordpres url slug
Updated On May 23, 2015 September 13, 2012 -Written ByAbility to organize content by assigning different categories is in-built by default in WordPress. For example: if your assign category “Guide”, then default URL for the category page will be [site.com/category/guide]. For every category URL in WordPress blog, “/category/” is added to the url slug of the category.
Do you want to remove “/category/” from the category(s) URL for more neater and shorter URL like [site.com/guide] instead of [site.com/category/guide]. Following are two ways to achieve this: using plugin or manual code method.
1. Use “WP No Category Base” plugin
Using WP No Category Base plugin is best and most easy way to remove “/category/” from URL slug for users not wanting to deal with complex manual coding. This plugin works out of the box, just install and activate it – URLs of all categories will be modified automatically and will not contain “/category/” in it now.
2. Manual .htaccess code method
Add following code to .htaccess file of your domain setup. This will remove “/category/” from category URLs in your WordPress blog. This method has one major limitation, it only works with default top level category URLs. It does not work with sub-categories and will throw 404 error for them.
[cc]
RewriteRule ^category/(.+)$ http://www.site.com/$1 [R=301,L]
[/cc]
Above replace www.site.com with your own blog url. Besides above, you can always experiment by using a different word in place of “category”. Goto Setting > Permalinks and you can type some unique word for “category” and “tags” under the Optional section at the bottom.