WordPress will automatically include the category name in the post’s URL by default.
Including the category name in the URL will help your users and search engines better understand and index your website.
The URL structure indicates what the post and the category are about to the readers.
Moreover, because every WordPress category has its archive page, the category name in the URL simplifies the navigation into that specific archive page.
However, some will say, and for a good reason, that a cleaner URL is more user-friendly and will benefit the overall SEO of your website.
Therefore, this article will teach you how to remove the category from the URL in every possible way.
Why Remove Category from URL
There are many good reasons why to remove the category name from the URL, and here are only some of them:
- Clean URL – stripped URL will look better and more visually appealing.
- SEO-friendly – helping Google to understand the article’s subject based on the keyword in the link.
- Uncategorized – by default, WordPress posts will have no category until you assign one to them. Posts without a category will have the Uncategorized text in the URL. We should eliminate that.
- Easier to remember – short links are easier to remember and will be shared more often.
Now that you know in which cases you should remove the category base from the URL, let’s move on and learn how to do it.
Remove Category from WordPress Permalinks
You can remove the category name from WordPress URL in three different methods:
- Permalinks settings
- Using a plugin
- SEO plugins
All the methods that I’ll show you are simple and easy to follow and will initially do the same thing.
Please remember to create a 301 redirect rule for your blog posts after changing the link structure of your website.
Remove Category from URL from the Permalinks Settings
It doesn’t require installing any plugin or using any codes because we will do it from the native WordPress dashboard.
This is the easiest way to remove the category from the link and, therefore, my preferred method.
Navigate to setting -> permalink and choose the custom structure option.
Add the category variable to the left of the URL slug and fill the category base field with a dot.
Save the changes and visit one of your blog posts to verify the new link structure.
Remove Category from WordPress URL Using a Plugin
No configuration is required when using the Remove Category URL plugin, making it another excellent option.
From your WordPress dashboard, navigate to plugins -> add new and search for Remove Category URL.
Activating the plugin is the only thing you’ll need to do to make it work.
Once activated, the plugin will remove ‘/category‘ from your category permalinks. (e.g. `/category/my-category/` to `/my-category/`).
Please note: deactivating the plugin will revert this process and the URL structure to what it used to be before the changes.
Removing Category from URL with an SEO Plugin
Here is another excellent method to remove the category from the URL structure because most of us already use an SEO plugin.
In this part, we will strip the category base from the URL with Yoast or RankMath plugins.
If you have Yoast activated on your WordPress website, you’re in luck.
Navigate to SEO -> search Appearance and enter into the taxonomies tab.
There, scroll to the bottom of the page and enable the ‘remove the categories prefix‘ option.
Enabling this feature will remove that /category/ prefix for categories only.
RankMath is another popular SEO plugin that quickly strips the category from the URL.
Once activated the plugin on your WordPress website, navigate to the Rank Math -> general settings screen.
There, toggle the Strip Category Base option to save the changes.
Just like we did earlier, enter one of your categories archive pages and verify that the category was removed from the URL successfully.
In this article, you learned how to remove the category from WordPress URL in every possible way.
Removing the category base from the URL is an excellent way to optimize your taxonomies pages. To take it a step further, learn how to display the category description in WordPress.
Leave us a comment and tell us which method you used to achieve this task.