Why and how to optimize Url slugs for WordPress?

They’re strange creatures, you may ask: slugs 🧌 are they super-villains of the web or your super-allies in SEO?

For the record, slug means slug. Phew, nothing really nasty in real life, that’s already a good sign. Back in the days of words printed on paper (for the younger generation), the lead typeface line used for letterpress printing was called “slug”.

Today, it’s in the field of Search Engine Optimization (SEO) that slugs have found their new letters of nobility. They play an essential role in the interpretation, and therefore ranking, of your online content.

Slugs provide search engines with important information about your pages. With predictive indexing, it’s a safe bet that these little slugs are even more interesting than you might think.

Gif de limace (slug) prête à prendre le départ
Source image Giphy

Table of contents

What are slugs?

A slug is a specific part of a URL that identifies a particular piece of content.

– Ouch! Thanks for the definition…

– You’re welcome 🤭

More precisely, it’s the text that follows the domain name in a URL.

For example, if you have a blog post entitled “My Great Article”, your URL might look like this: ” https://mon-site.fr/mon-super-article “.

In this example, ” /my-super-article” is the slug.

illustration slug

Slugs are used for content types such as pages, articles, images, categories and tags. It’s the unique identifier of a publication, found at the end of the URL.

They are used to organize content and facilitate navigation on your website.

They also have a major impact on search engine optimization (SEO), as they help Google save resources when indexing your site. In this respect, slugs work in tandem with title and meta description tags for predictive indexing (i.e. will Google want to crawl your page to index it?). That’s right, SEO bots are all about the least effort.

What is a slug?

A slug is one of the elements of a permalink, composed of short, descriptive words that relate to the content of a specific page or post. It is generally used to make a URL more attractive to the end user, by giving a preview of the information found within the post or page.

The slug is an important part of your SEO strategy, as it tells users and search engine spiders what they’ll find on your page. It’s therefore important to think about the structure of your permalinks beforehand, because it’s not enough to just put your keywords in them. In a way, your site is an airport, and the slugs represent the departure gates. And everyone prefers to know where they’re boarding 😉

Important points to remember:

  • Slugs must be simple to understand and easy to remember. They should reflect the content of the page and be relevant to the topic.
  • While it’s best to keep slugs fairly short, it’s essential that they are long enough to include important keywords. They still need to be meaningful to your users (think user experience first).
  • Slugs still allow search engines to correctly rank the page to make it available to users in search results.
  • Some content management systems (CMS) like WordPress automatically create a slug from a page title.

How to use slugs

Ideally, a slug should correspond to a single resource, which means that a slug type must be unique. It should also be user-friendly, i.e. perfectly comprehensible, as it is primarily intended for the user.

Slug construction is fairly rigid, and the use of accentuation or special characters so dear to the French language is forbidden. The same applies to punctuation. By default, WordPress will “clean” your slug of all such elements. Commas, apostrophes, accents and any other unauthorized characters will be removed, and spaces replaced by dashes to separate words.

So if the title of your page or article is: Relaxing stay at the Excelsior Hotel: Enjoy a “dream getaway” in an enchanting setting!

WordPress will automatically generate the following slug: sejour-de-detente-a-lhotel-excelsior–profitez-dune-escapade-de-reve-dans-un-cadre-enchanteur

exemple de slug genere automatiquement
Example of a slug automatically generated by WordPress

Well, you have to admit it’s not very sexy, is it?

Don’t worry, we’re going to optimize the whole thing to create a nice, self-explanatory URL that’s easy for everyone to read.

Step 1: Add a title and save the draft

etape 1 titre et enregistrement brouillon
Step 1: Add title to article and save as draft

As soon as you create a new article or page, WordPress will assign it an identifier. For WordPress to transform it into text, and for you to be able to modify it, you must first add a title to your page, and then save it as a draft.

Step 2: modify the URL slug

etape 2 optimistion du slug
Step 2: Optimize the URL slug automatically generated by WordPress

To modify your slug, you need to be in the post tab of your publication, where you’ll have access to the URL insert. There you’ll find the slug automatically created from the post title. Now all you have to do is optimize it.

Step 3: Optimize the slug

In this case, we end up with: sejour-de-detente-a-lhotel-excelsior–profitez-dune-escapade-de-reve dans-un-cadre-enchanteur.

So we’re going to give our slug a little facelift, starting by deleting unnecessary linking words, the famous “stop words” and also duplicate hyphens.

Then we’re going to keep our key words for this publication, those that define what we want to communicate to our readers on this page.

The slug thus became: sejour-detente-hotel-excelsior. A little better than the previous one, don’t you think?

Important to note: if your site is that of the Excelsior Hotel, there’s a good chance that its name is also that of your domain name. So there’s no point in repeating it in the slug. We’re not going to write“https://hotel-excelsior.fr/sejour-detente-hotel-excelsior” 😈

Finally, beware of slugs generated automatically by WP, as they are rarely relevant. Always check your slug before publishing your article!

How do slugs influence SEO?

Slugs are very important for SEO, as search engines analyze them to learn more about the content. This helps pages rank higher in search results.

Good slugs tell search engines that the page content is relevant to users’ queries. Bad slugs, on the other hand, can be detrimental to your page’s ranking.

Watch out for slug changes after publication

It’s important to check your slugs carefully before publishing your article (spelling mistakes, poorly optimized slug…) because once the article has been put online, WordPress will have created a permalink. A permalink, as its name suggests, is a permanent link to your page, and any change in its structure will generate a 404 error (“Page not found”). When a user or search engine tries to reach the page via the old URL, it will no longer be available, and your visibility in search results may suffer.

So if you absolutely must change the URL of a page, you need to redirect the old URL to the new URL with a 301 redirect so that search engines can follow the link and update their index. Free plugins such as Redirection, 301 Redirects or Safe Redirect Manager will help you manage your redirects correctly after a slug change.

How to optimize slugs for SEO, in a nutshell?

Here are our top tips for optimizing slugs for SEO:

1. Use keywords

Include keywords relevant to your topic in the slug. Keywords can help search engines quickly understand what your page is about and rank it correctly.

2. No unnecessary words

Avoid unnecessary words, determiners and stop words, such as “the”, “the”, “in” and “of”. Keep to the essentials and focus on clarity.

3. Be clear and concise

Try to keep slugs as short as possible, without sacrificing keyword relevance. Search engines prefer slugs composed of keywords to full sentences. Nevertheless, it’s important that humans can read your slugs.

4. No duplication

Never use the same slug for several pages, otherwise the robots won’t know which one is relevant (by the way, WordPress doesn’t allow this and automatically increments the new publication, so the slug for a second contact page, for example, will automatically be transformed into “contact-2”). Each page must have its own unique slug, in the same way as it is structured around a main keyword.

Finally, if you’re using a CMS like WordPress, plugins like Yoast SEO will help you configure and optimize your slugs. They can also help create more attractive slugs and ensure that they comply with SEO standards.

Slugs are your friends

Clear, descriptive URL slugs are useful for both visitors and SEO robots. They help your visitors understand the content of your page at a glance, and they tell the spiders what the page is about.

So remember that these few words play an important role in SEO. Slugs should be considered a key element of your SEO strategy.

In conclusion, concise, content-representative and unique URL slugs can help improve your site’s visibility in search results, while offering a user-friendly and informative experience.

Leave a Reply

Your email address will not be published. Required fields are marked *