SEO basics What's a slug and how to optimize it

In SEO, we often talk about creating the right slug for a page. But what is this really? And why should you optimize it? In this post, we’ll explain all you need to know about it.

What’s a slug?

A slug is the part of a URL which identifies a particular page on a website in an easy to read form. In other words, it’s the nice part of the URL, which explains the page’s content. In this article, for example, that part of the URL simply is ‘slug’.

Here’s how Joost explained slugs in an Ask Yoast video:

WordPress slugs

In WordPress, it’s the part of your URL that you can edit when writing a new post. Note that this only works with the right permalink settings. It looks like this:

slug-slug

If you have added more variables to your URL, we’re still talking about just that editable part of the URL to the page, like this:

slug-ocw

There’s an additional value at the end of that URL. In this case, that extra variable is used so slugs can be the same without the URL being the same. I think these examples clearly show what the slug we are talking about is.

What does a slug mean for SEO

The SEO benefit of a slug is that you can change the words to make sure that it has the words that you really want to rank for. It’s one of the indicators Google uses to determine what a page is about. It’s also one of the things that people see in the search results. You always see ten different URLs about a certain topic, like WordPress SEO, right? Our main article on this has the URL yoast.com/wordpress-seo, which is very on point. People might click on that a lot easier than if it’s yoast.com/?P=613458, which what WordPress does by default.

Find out more about creating SEO-friendly URLs »

Optimizing your slug

What are the things you need to think of when constructing the right slug for your post or page? Let’s go over a number of characteristics you need to take into account:

No stop words

Filter out all the unnecessary words. Filter out “a”, “the” and “and” and similar words. We have written a tad bit more on stop words in our WordPress SEO article. For users of our Yoast SEO plugin: you might have noticed we filter stop words out by default.

Add focus

Don’t just filter out stop words, but really all the words that you don’t need. Make sure the slug still makes sense though. In the case of this post, WordPress automatically creates the slug “what-s-a-slug-and-how-to-optimize-it” (based upon the permalink settings in WordPress), which I manually reduced to “slug”.

There is one thing to keep in mind here. “Slug” as a subject is not likely to get another page on its own on our blog. This informative article will most probably remain the central point for information about slugs on our website. So I can reduce the slug to just “slug” for that reason. If this was an additional post to the main article, it would probably have been something like “optimize-slug” (and I wouldn’t have explained what it is, for that matter). So, do consider the page’s level or position on your website.

Keep it short, but descriptive

The URL of your page is shown in Google search results. Not always, sometimes it’s for instance replaced with breadcrumbs (awesome). Don’t include too much information if you intend to reuse the URL for article updates. Be careful with dates and such:techradar mindmap slugSo you need to keep that in mind as well. Next to this, a short slug, right after the domain, will allow Google to show keywords in its mobile search result pages as well.

Now go optimize your slug with these three things in mind!

Read more: SEO basics: what does Google do? »

Make Yoast SEO & Woo work together smoothly

  • Make your products stand out in Google
  • Get more buyers to your online store
  • Make products easier to find on your site
  • Have a cleaner XML sitemap & more
More info

11 Responses to What is a slug and how to optimize it?

  1. Darek Szmit / Poland
    Darek Szmit / Poland  • 4 months ago

    Thank you for useful information. I recommend everyone to the seo plugin, I have been using it for several years and I am very happy. All the best :)

  2. Gracious Store
    Gracious Store  • 4 months ago

    Thanks for explaining these technical terms. Knowing what each term means makes it easy to use or implement correctly.

    • frank robbins
      frank robbins  • 4 months ago

      I read the article and still don’t get it

  3. wasim akram
    wasim akram  • 4 months ago

    Sir Yoast is the best plugin for SEO and optimizing the slug. But suppose if we have written 100 articles and we want to optimize them. Then in large number how can we do it?

  4. David White
    David White  • 4 months ago

    Thanks for making SEO something I want to improve and not hide away from !

  5. Sagar Bogati
    Sagar Bogati  • 4 months ago

    First of all, thank Michiel
    This post is awesome too because optimizing the slug is the main work for on page SEO. The slug should be descriptive, easy to use, crawlable. Afte reading this post I got knowledge all of above.

  6. Thomas
    Thomas  • 4 months ago

    That’s a great article! I had no idea that WordPress has it, It makes everything so much easier

  7. EmRatThich
    EmRatThich  • 4 months ago

    Thank you Michiel. I really love the way Yoast present the slug in the plug-in. One tip: Use similar word as your slug, helps SEO.

  8. Sam
    Sam  • 4 months ago

    Thanks, great blog

  9. Epic Kenyan
    Epic Kenyan  • 4 months ago

    I tend to disagree with Yoast to an extent when it comes to stop words in the slug because most of my posts that are meant to rank have long tail keywords which need stop words. They would not read properly without the stop words. They also tend to rank well on the first page of google when optimized properly. So I leave that option unchecked in Yoast plugin settings.


Check out our must read articles about SEO Basics