Skip links

4 Ways – Remove Category from WordPress URLs

You receive SEO benefit and better user-friendly URLs if you remove category slug from WordPress URLs or Permalinks. Remove category means removing /category/ from category URLs on a WordPress website. Of course, there are 4 various ways to achieve this.

We want to let the slug of category taxonomy appear in URLs but not the slug or word category itself. So the URL will be after category removal.

Remove Category from WordPress URLs

Below different ways to achieve the same. Just note that if you have a fresh WordPress installation then setup permalinks as you wish. But if you change permalinks structure on a live site, properly redirect old URLs to new ones to avoid loses.

Remove Category from WordPress URLs with a Dot

1. Go to Settings -> Permalinks.
2. Select Custom Structure and put /{136ce94cc7fec1f5657bab0b4d73ed308318c1024f899c463e79e42d4b375fbf}category{136ce94cc7fec1f5657bab0b4d73ed308318c1024f899c463e79e42d4b375fbf}/{136ce94cc7fec1f5657bab0b4d73ed308318c1024f899c463e79e42d4b375fbf}postname{136ce94cc7fec1f5657bab0b4d73ed308318c1024f899c463e79e42d4b375fbf}/ there.
3. Assign a dot to Category base field and save the change.

Remove category slug using dot

Note that providing dot to Category base in settings is the must. As leaving it blank will use the default value. Visit a post after saving settings and check the URL, it won’t have the category base now. While this trick currently works, there’s no assurance that it will work in the future as well.

Remove Category From Your URLs with .htaccess

RewriteRule ^category/(.+)$$1 [R=301,L]

You can also add this code to your .htaccess file through FTP rather than using a dot. Add the code before the closing </IfModule> tag in the file and it will remove the category slug from WordPress permalink.

Are You using Yoast SEO Plugin?

The current version of SEO by Yoast plugin has discontinued the option of category removal from URLs. Past version had the option in the Advanced menu of plugin settings. The websites who’re using Yoast for a long time, still have their URLs without the category base.

If you’ve installed Yoast plugin on your fresh WordPress website, check the post URLs as well. While we’re not sure, the feature might be still there and working silently. Else there are other plugins as well to remove category slug.

If you’re about to launch a WordPress website then don’t forget reading 10 checks before you launch it.

Removing Category from Slug using a Plugin.

The plugin Remove Category URL seems quite popular and offers additional advantages. You can try the plugin if your website is older than 6 months. It will redirect the old category permalinks to the new ones, which is better for SEO. Also, you don’t need to configure anything or modify a file. Get the WordPress official plugin URL here.

FV Top Level Categories is one another plugin to remove category base from WordPress Permalinks.

Writing a function is also a way for the functionality but it makes the site slower. At last, all four ways to remove the category slug from URLs are there. Which one do you prefer or any feedback/question? Let us know it the comment section below and try resolving.

Join the Discussion

Return to top of page