Slugs are a very important part when designing a web page and not taking them into consideration can be one of the main factors why your website does not rank in Google.
In my career as a web designer and SEO consultant I have come across many projects that from the beginning have led to mismanagement of slugs and for this reason that website has not had the expected growth.
The configuration of slugs in WordPress must be done well from the beginning so that the structure of the website at the content level is visually clear to the user and at the level of web positioning is effective.
In this article you will see what slugs are in WordPress and how you have to work with them so that the project you have in hand reaches the highest possible level.
What are slugs in WordPress?
Slugs in WordPress are basically the structure of the url, it is the name that you add after the name of your domain in each of your pages or entries on your website.
– I give you an example:
Imagine that you are creating your website and you are going to create a page called:
“Where to eat a seafood paella in Valencia?”
If you are familiar with WordPress you will see that by default this CMS takes the title to add it as slugs and the most normal thing is that the url (slug) is this:
You can also find that WordPress has set this url:
These urls are not too successful And you are in control of them since they can be changed as you will see throughout this article where you will also learn to carry out a good slug strategy so that each one created on your website makes sense and is effective.
How to choose permalinks for my website (permalinks)
When you have just installed WordPress the first thing you have to do is choose a type of permanent link structure for all urls on the web.
If you choose an unsuitable structure for the website you are going to create, you will have a problem in the future if you want to change it.
WordPress> settings> permalinks.
Unless you have a newspaper or magazine where you have special interest in including the date in the slug because the content is updated daily, it is best to choose a friendly url such as the one established by default as the option “Input name”.
By choosing this option as you see in the image above, the user will see a clean url and Google or the other search engines will better understand the url structure of your website.
Otherwise imagine a url like this for example:
The number that appears at the end is the ID which assigns WordPress to that created page.
As you see, it is neither aesthetically attractive, nor does it contribute anything to the user and is detrimental to the positioning of the web.
* It is important not to change the url structure in the future. If you did, you would have to do redirects, since you would be causing 404 errors (non-existent pages) that you would have to fix being very harmful to the SEO of the web if it is not done well.
The recommended thing for usability and positioning is to choose the option established by default “Entry name”.
How to create slugs in posts and pages
Every time you create a new page or post, a url is associated with that content.
This url will be created automatically as I told you at the beginning of the article.
In most cases, the ideal is to edit that slug making it as short as possible and optimize it for SEO.
Editing that url is very easy. Once you create the new page where the default title will come to you, you will see (as I indicate in the image below) the url field below it; if you click edit you can change that slug.
* This url field appears once you create the title and click save changes (do not click publish or what you have created so far will be visible to everyone).
It is important that the terms used for slug are lowercase lettersgo separated by central hyphens (-) and that avoid using tildes and other characters like the letter ñ.
There are more ways to do it …
For example, you need an SEO plugin to handle the different Slugs since automatically urls will be generated with slugs that we do not want search engines to visit or show in their results.
With the plugin Yoast SEO We achieve this in addition to allowing you to have another way to edit the slugs of any page or entry directly, since it also allows you to do it from your options.
Learn to configure this plugin and work well on WordPress slugs easily thanks to this free Yoast SEO course.
How to change slugs in categories and tags
Category slugs work the same as posts and pages.
To access them you have to go to the option Tickets> Categories.
Fill the slug field with terms that define the category briefly.
* Labels are created just like categories.
You can change the url of each category by clicking edit in each one, but you have to be careful to do so since you will be generating an error in the old url when it ceases to exist.
Further, a change of the slug in categories can influence the entire positioning of the web since all the articles hang from a certain category and if these are being indexed it can generate a major search engine crawl problem.
We will see below.
How to change the Author slug
By default, the author’s slug is the username.
You cannot change the username of a WordPress account by default after creating it. But as for everything there is always a plugin.
With the plugin Edit Author Slug You can change the name of the authors of your website.
Once installed and active, now when editing users, you can assign another name to the author slug.
How to change slugs in online stores (WooCommerce)
The online stores created in WooCommerce have the problem of dealing with slugs not entirely correct.
Every time you create a WordPress product or category it creates URLs of the type:
WordPress creates a kind of previous directory to organize the information in this way and this can be good and bad at the same time from the SEO point of view, since it is a longer url and with greater depth of crawling.
With the plugin Woocommerce Permalink Manager You can make said intermediate slug disappear so that the URLs of your website are 100% friendly as follows:
More sites on the web where slugs work
Slugs in WordPress are not only created in posts, pages or categories, they also exist in:
- Attached files.
- Portfolio and plugin extensions.
- Filters in online stores.
The urls generated by default in some plugins, such as the product filters in Woocommerce, are generated automatically and are not modifiable.
The solution to not have duplicate content problems etc, is to use SEO plugins like the mentioned Yoast.
SEO for Slugs
Slugs play a huge role in SEO. Although it is true that search engines like Google go much further than a simple url.
It all adds up to SEO and however little it may be, the truth is that a well-optimized url helps a lot with web positioning.
When writing each url of a page, entry or category it is important to take into account these factors:
The url must include the keyword to be attacked, which will normally be similar to the title.
It should be as short as possible, using 4 or 5 words at most and removing if possible articles, prepositions, conjunctions …
Example: If you have written a post about “The best beaches to surf” you can use a url like “best-beaches-to-surf”.
If the domain already contains that keyword, it may be a good idea not to duplicate it.
For example, imagine that your website is shoesbaratos.es. Creating a url called shoesbaratos.es/de-tacon/ can be an idea to consider since the domain already includes the keyword.
Be careful in indexing the urls created by default with plugins, authors or product filters in Woocommerce. A plugin like Yoast SEO helps these urls not get indexed.
If you modify a url with a new slug, you have to do a job of internal redirects on the links that pointed to the old one to avoid double redirection (it helps with Google tracking).
Beware of cannibalizations: you have to be careful that the urls are as different as possible and of course not repeat (although WordPress already takes care of including a -2 when detecting the same url).
If the url is unique and WordPress keeps adding a -2, it could be that you have some entry in drafts or removed with that url.
Delete it or create a title with a different url.
Beware of mirror links
Mirror links are very common on any website and can cause duplication and confusion in Google when understanding that they are different urls.
They basically occur when we create internal links without including the / at the end.
Imagine creating a link that points to the home page like this: low-heeled shoes.
And another link in another part of the web that is shoesbaratos / de-tacon /.
This is a mirror link and it must be avoided since Google or the rest of the search engines can interpret that these are different urls.
WordPress slugs are very important. I find many projects that are not working at the SEO level because they have a bad job in the urls.
The user needs to see in each slug the theme of the post or page that they are going to read, since it appears in the Google serps or in the browser and invites them to continue reading when they know what the content is about.
Search engines need the same thing, make it easy because a good part of your SEO strategy involves having some optimized urls.
If you want to make your website go up in Google and have a friendlier structure, you have to do an important url restructuring job, and if you are working to launch your new website, you already know the importance of slugs in SEO of your web project.
Web Designer, SEO and Digital Marketing Consultant | I work as a freelance creating websites for clients who want to grow their business through the internet | Also, I teach in my Blog how to create a web project absolutely from scratch | You can find me on social networks.