Last Updated on October 14, 2019 by Dave McLean
Having nice-looking URLs for your WordPress posts can be slightly disrupted by one of WordPress’s default functions; adding the ‘category’ base to the post URL. Here are some various ways you can remove the category base from the URLs in your WordPress posts.
There are various ways you can remove the category base from your WordPress posts, each ranging in difficulty and technical ability. Any of these options will help you to remove the category base from your WordPress posts, no matter which one you choose. Let’s get cracking into the options:
Create a custom structure in your permalinks settings
One of the easiest options is to use the WordPress Permalinks settings to create a custom structure for your blog posts. This allows you to remove the category base and lets you customise the way your post URLs look like. Here are the steps you need to take to use this option:
- When you are in the WordPress admin area, click on Settings in the left menu.
- Click on the Permalinks submenu item.
- Click the Custom Structure radio button option, and then type in /%category%/%postname%/. Or you can click the two tags themselves under Available tags. This will make the post appear like https://davemclean.net/wordpress/example-post-name/ for example.
- Don’t forget to save your changes otherwise, the new custom URL structure, with the category base removed, won’t be used throughout your website.
Use the Yoast SEO plugin
The Yoast SEO plugin is one of the most popular SEO plugins that you can use on your WordPress website. One of its small features is that it can remove the category base from your WordPress posts. If your website uses the Yoast SEO plugin, this is a simple option where the plugin does the technical work for you. Here is how you use this function in Yoast SEO:
- When you are in the WordPress admin area, click on Yoast SEO in the left menu.
- Click on the Search Appearance submenu item.
- Click on the Taxonomies tab.
- Scroll down to Category URLs at the bottom of the page and select the Remove slider option
- Don’t forget to save your changes otherwise, the new custom URL structure, with the category base removed, won’t be used throughout your website.
Use the .htaccess of your website
The most technical option in this list is to add a line of code to the .htaccessfile of your website. But this technical option is also one of the easiest, if you don’t want to use a plugin.
There are various reasons why this option may appeal to some WordPress users, one being that it doesn’t require a plugin or any navigation through WordPress settings.
If you have access to the .htaccess file of your website, all you need to do is add this line of code to your .htaccess file:
RewriteRule ^category/(.+)$ http://www.site.com/$1 [R=301,L]
Remove the category base with a plugin made for the purpose
If you don’t use the Yoast SEO plugin, and you would prefer to use a plugin to remove the category base from the URL of your WordPress posts, then the Remove Category URL plugin may be the option for you.
I would personally recommend using one of the other options, as using too many plugins on your website helps to slow your website down.
But if you are still keen to use a plugin with the sole functionality of removing the category base from the URL’s of your WordPress posts, then this plugin is for you.
To sum things up
There are multiple ways to skin a cat when it comes to removing the category base URL from your WordPress posts. Some of the options require a little bit of technical skill, while others use the plugins to complete the job.
Whether you are a web developer or a blogger with no web development skills, you can use any of the options in this list to remove the category base URL from your WordPress posts.
Are there any options that are missing from the list? Are there any improvements that can be made the options already in the list? Let me know in the comments below.
Something else you may want to do on your WordPress website is to remove the uncategorized category option from your posts. This works well in tandem with removing the category base from your URLs in your WordPress posts.
And as always, have fun making awesome WordPress websites!