Need to modify the PHP version of your website? That’s where it happens. Need to create an email address? That’s where it happens too. Need to install an SSL certificate on short notice? Here again. Where? On your WordPress site’s…
Do you want to change the URL of the categories and tags of your WordPress site or blog, without impacting your search engine optimization?
Good idea! Because, by doing so, you can improve your positioning in search results, as well as the user experience, by making your web pages more intuitive to visit.
We will see in this tutorial how to proceed step by step to get there, always following good SEO practices to keep your achievements.
A little precision before you start. When it comes to changing URLs, you need to take the following two things into account in your configuration:
- The base of categories and tags on your WordPress installation
- The slug(s) of your categories and tags
These two parts will form your final URL address: they are therefore to be differentiated and taken into account.
No need to be a developer here, nor to get your hands in HTML, PHP, or any other obscure acronym for beginners: it’s all quite simple, under WordPress directly!
Make a backup of your site and your database before any modification. You never know 😉 To avoid the cataclysm, take a look at the WPMarmite guide on how to backup WordPress!
Let’s get started!
Overview
In this post, you’ll see affiliate links. That’s a way for WPMarmite to get a commission if you buy one of the products or services through these links. The price remains the same for you, don’t worry! In the meantime, it helps us rewarding our blog’s writers.
Changing the base of WordPress categories and tags
The base for categories and tags on WordPress is the part of the URL that is present right with the category name.
Let’s take a simple example with the URL of the following website: https://mysite.com/categories/travel
You have your domain name, then the base which is here /categories
, with as category travel
.
It is the same for the tags: https://mysite.com/tag/china
The tag base is /tag
and the tag is china
.
These bases are, by default, the same for all your categories and tags. So you won’t be able to define a different one for each of them.
Ideally, you should edit your bases when you create your WordPress site, before publishing it online. If this is not the case, you will absolutely need to do redirections so as not to impact your SEO and display 404 errors to your visitors. You want to do your redirections properly? Feel free to read our comprehensive post on the subject!
To change your bases of tags and categories, go to your admin dashboard, and then go to Settings > Permalinks:
Under the Optional section, change the existing bases by the ones you want and click Save Changes.
Your bases are now modified according to the needs of your site. Fingers in the nose, right?
Now let’s move on to the slugs in our categories.
Modify the slug of WordPress categories and tags
Now that you’ve edited the bases, let’s move on to the second part of your category and tag URLs: the slug.
Let’s take the previous example again. We had the following URL: https://mysite.com/categories/travel
We still have our base, and the slug of the category is /travel
.
Same for our tags: https://mysite.com/tag/china
The slug is here /china
.
To access your category settings, go to the WordPress administration, then go to Posts > Categories.
Here is what it looks like on WPMarmite:
When you add a new category, enter a specific slug that defines your category.
Don’t forget to respect the good practices of an ideal slug URL:
- Do not include any stopwords, uppercases, or accents
- Keep it short and understandable
- Include the main keyword of your page in it
You can then set-up your slugs by choosing a category from the list on the right. You can also view the slug of each of them:
The slug of the WPMarmite WordPress Tutorials category is wordpress-tutorials
.
To modify a slug, move your mouse over a category and click on Quick Edit:
Then edit the slug to replace it with the one you want and save the changes.
Then go back to Settings > Permalinks and click on Save Changes to make sure the new setup is taken into account, and avoid 404 error pages.
Again, remember to redirect every time you edit URLs so that they point to the new ones, and don’t penalize your website on Google.
Bonus: Removing bases from WordPress categories
Sometimes it’s better not to display the base of WordPress categories at all, in order to shorten URLs and make your site tree structure clearer.
Well, don’t worry: it’s possible, and very simple.
All you need to do is install the WordPress Remove Category URL plugin and activate it from the back office: it will allow you to disable these bases.
No settings are necessary and, icing on the cake: the redirections are done automatically. All good stuff!
Note that if you use a SEO plugin like Yoast, SeoPress or Rank Math, an option is often available to remove the base of categories.
Please note that the process is also the same to change the base of your ecommerce products on WooCommerce, as well as their category.
And here you are with custom category URLs and tags as you should be, without impacting your natural SEO!
Receive the next posts for free and access exclusive resources. More than 20,000 people have done it, why not you?
Hi,
Thank you for the article.
I have a specific scenario – I created a custom category say Fruit Basket. So the slug created was fruit-basket in the category page URL.
But I want the category URL to be http://www.xyz.com/fruit instead of http://www.xyz.com/fruit-basket
I cannot modify the slug since there are other things mapped to the slug and changing the slug would break the code.
Please suggest how to achieve this?
Hello, you can add some redirects rules with Redirection plugin 😉
What are your suggestions on /product/ base of URL?
In Woo documentations, we found that they do not recommend removing /product/ or /product-category/. But at the same time, they have a plugin for this purpose on their marketplace.
So what is right to do?
Hello, it’s best to keep them to avoid URLs conflicts 😉
Can you create tutorial for Yoast on how to remove that category base that you mentioned at last?
Hello, like this one : https://wpmarmite.com/en/yoast-seo/ ?