CodeBriefly
Tech Magazine

Remove Category from URL – WordPress

0 2,714

Get real time updates directly on you device, subscribe now.

In this article, we will discuss “Remove Category from URL WordPress”. WordPress provides an easy way to manage URLs. When we create categories in WordPress then the URL contains the category keyword. It is default nature of WordPress. This will increase the length of the URL, sometimes we need to remove the category from URL so make our URL shorten and easy to manage.

There are so many ways to remove the category from URLs.

Remove Category from URLs with Permalinks

You can use the following steps to update your URLs.

Step 1: Go to Settings -> Permalinks.

Remove Category from URL WordPress

Step 2: Update the permalink custom structure. Add category and post name in the custom structure.

Remove Category from URL WordPress

Step 3: Now, time to update the “Category base”. Add the dot in category base and save the changes.

Remove Category from URL WordPress

Adding a dot to category base in the setting is mandatory. As leaving this field blank will use the default value. You can check the URL after and before the update of the above mention settings. Currently, this trick is tested within the latest version of WordPress. But there are no guarantees that it will work in the future as well.

Remove Category from URL with .htaccess

Add the following code snippet in your “.htaccess” file.

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

The above code snippet helps you to remove the category slug from WordPress permalink.

Remove Category from URL using Yoast SEO

Most of the WordPress site using Yoast SEO Plugin for fulfilling their SEO requirements. Yoast provides an easy way to remove the category from the URL. You need to use the following steps:

Update taxonomies setting in Yoast.

Remove Category from URL WordPress

After updating the Yoast setting, you need to update your permalinks as per the given screenshot.

Remove Category from URL WordPress

One thing you need to remember, if you are not selecting any category then the post will be done automatically assigned to default category “uncategory”. You can change this as per your requirement. Also, if you change the primary category then the post URL changed as your selected category.

Removing Category from URL with a Plugin

Some of the plugins are available, which help us to remove the category from the URL such as Remove Category URL and FV Top Level Categories. Plugins provide the additional benefits, I am choosing randomly both the plugins. Maybe other plugins are available, You can choose as per your research.

Conclusion

In this article, we discussed “Remove Category from URL – WordPress” a WordPress tip. Please feel free to add the comment if any query or you can submit your feedback. Also, write us if anything I missed in this article.

If you like our content, please consider buying us a coffee.
Thank you for your support!
Buy Me a Coffee

Get real time updates directly on you device, subscribe now.

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. AcceptRead More