Remove category & tag base from WordPress url - without a plugin

60

I would like to remove the category & tag base from WordPress URL. I have come across other posts and solutions which used plugins. I would like to stay away from plugins and have a solution from within functions.php. This would prevent any future plugin updates or WordPress default files from being changed.

Any help would be appreciated. Thanks!

I have tried these solutions so far:

This question is tagged with wordpress categories base

~ Asked on 2013-07-22 22:54:37

The Best Answer is


68

If you want to remove /category/ from the url, follow these two steps:

  1. Go to Settings >> Permalinks and select Custom and enter: /%category%/%postname%/
  2. Next set your Category Base to .

Save it and you’ll see your URL changed to this format: http://yourblog.com/quotes/

(Source: http://premium.wpmudev.org/blog/daily-tip-quick-trick-to-remove-category-from-wordpress-url/)

~ Answered on 2014-01-03 19:21:35


32

If you use Yoast SEO plugin just go to:

Search Appearance > Taxonomies > Category URLs.

And select remove from Strip the category base (usually /category/) from the category URL.

Regarding the tag removal I did not found any solution yet.

~ Answered on 2016-07-31 10:13:36


Most Viewed Questions: