What Is a Slug? URL Slugs and Why They Matter for SEO


What Is a URL Slug?

A URL slug (also known as website slug) is the last part of the URL address that serves as a unique identifier of the page.

For example, the article you’re reading now has a URL that looks like this:

https://semrush.com/blog/what-is-a-url-slug/

The URL’s slug is “what-is-a-url-slug”.

url slug

Why Is a URL Slug Important for SEO?

A URL slug is often considered a great place to include the target (or primary) keyword of a page.

After all, Google Search Advocate John Mueller has confirmed that words in a URL are a ranking factor. 

But he also emphasized that it is a “very very lightweight” one, and it primarily helps to assess the page before Google accesses it.

In one of his tweets, Mueller also said:

In other words:

Even if having keywords in the URL is a ranking factor, we should not overestimate its effect on rankings.

However, it may still make sense to use the target keyword of a page in a URL slug. Especially considering the user experience (UX) point of view, which is closely connected to SEO.

Let’s take a look at these two examples:

  • https://website.com/blog/rock-climbing
  • https://website.com/blog/82354

While the first example provides clear information about the content of the post, the latter is just a chain of numbers that doesn’t provide any added value. 

If someone only saw these two URL addresses, they’re much more likely to click the first one. (Regardless of the actual content on either page.)

That’s why a URL slug should provide a concise description of a page. As it happens, a great way to do this is to use the target keyword. 

Tip: Use a keyword tool like Semrush’s Keyword Magic Tool to find the best target keywords for your website. If you’re not sure how to start, follow our keyword research guide

URL Slug Best Practices

Let’s take a look at some best practices and tips on how to create good URL slugs.

Be Descriptive

As we’ve already mentioned, the primary role of URL slugs is to make URLs more user-friendly. Therefore, they should describe the content of a page.

  • Good URL slug: /best-air-purifier
  • Bad URL slug: /2575

Using the target keyword is a great way to achieve this. Why? Because it is usually an accurate, yet very short, description of what the page is about. 

This brings us to the next tip …

Make It Concise and Easy to Read

A good URL slug shouldn’t be too long. Long URLs are harder to read and/or remember. Try to use fewer than five words in your slug. 

  • Good URL slug: /abs-exercises
  • Bad URL slug: /the-best-abs-exercises-for-all-levels-of-gym-goer

Moreover, a URL that is too long will get truncated in Google search results. While this is not an SEO disaster, it doesn’t make the page snippet look very good.

long url slugs get truncated

Separate Words

How you separate the words (or not) influences the readability of a URL slug. Separating the words in the slug helps users understand the URL more easily. 

  • Good URL slug: /best-travel-tips
  • Bad URL slug: /besttraveltips

Use Hyphens, Not Underscores

The best practice is to use hyphens to separate words in URLs. Search engines may not correctly interpret other separators (like underscores). 

  • Good URL slug: /good-old-fashioned-pancakes
  • Bad URL slug: /good_old_fashioned_pancakes

Tip: Semrush’s Site Audit will detect URLs that use underscores, as well as many other issues related to URL addresses. Try it for free.

Use Lowercase Characters

Since URLs can often be treated as case-sensitive, it is best to stick to lowercase characters to avoid any issues and make it easier to write the URL manually. 

  • Good URL slug: /new-york
  • Bad URL slug: /New-York

Avoid Special Characters

Google Search Central recommends avoiding non-ASCII (American Standard Code for Information Interchange) characters, such as special characters of some languages or emojis. 

  • Good URL slug: /emoji-meanings
  • Bad URL slug: /??

Make It Future-Proof

It is best to avoid numbers that are likely to be changed in the future, like a number of tips or ideas or the publishing year.

  • Good URL slug: /how-to-write-url-slugs
  • Bad URL slug: /10-tips-to-write-url-slugs-in-2022

Note: If you do have to change the URL slug, make sure to redirect the old URL to the new one. 

URL Slugs & WordPress

Since WordPress is the most popular CMS in the world, let’s take a closer look at how to change a URL slug in WordPress. 

First and foremost, you need to make sure your permalink structure will allow for user-friendly URL slugs.

Go to “Settings” and click “Permalinks.”

Here, you’ll be able to select one of the basic permalink structure types or create a custom one. We strongly recommend using the “Post name” structure.

choose permalink structure

This way, WordPress will automatically create URL slugs based on the title of your page or post. But more importantly, it will allow you to edit the URL slug.

To change a URL slug in WordPress, you’ll need to go to the editor of a specific post or page.

Here, in the right panel, you’ll find the “URL” section. After clicking the automatically generated slug, you’ll be able to edit it.

change url slug in wordpress

If you’re using the Yoast SEO plugin, you can also change the URL slug in the Yoast SEO panel at the bottom of your editor. 

yoast seo plugin url slug

The plugin’s “SEO analysis” section will also notify you if your URL slug does not contain your focus keyphrase (i.e., the target keyword).

seo analysis

Take this as a recommendation you can follow if it makes sense for you—not something you need to do at all costs.

As we’ve established earlier, keywords in URL slugs have a very small SEO impact. You should primarily focus on the UX rather than keyword stuffing. 

Note: Most other content management systems (CMSs) allow you to customize URL slugs. Here’s how to do that in Wix, Shopify, BigCommerce, and Squarespace.

Read our guide to WordPress SEO to learn more about how to optimize your WordPress website.

FAQs

Are Website Slugs Important for SEO?

Yes, URL slugs are important for SEO. They are an important user experience element. And UX and SEO are closely connected.Words used in URLs are also a very lightweight ranking factor.

What Is the Difference Between a URL Slug and a URL?

The URL is the entire web address of a page, while the URL slug is just the last part of the URL that serves as an identifier of the page.

  • URL: https://www.apple.com/shop/iphone-12
  • URL slug: /iphone-12

What Happens When You Change the URL Slug?

Once the URL slug is changed, the whole URL address of a page is changed. It means the page can’t be accessed through the old URL address anymore. 

Every time you change the URL slug, it is best practice to set up a 301 redirect from the old URL to the new one. 

This way, you’ll prevent users from landing on a 404 error page. As well as a potential loss of traffic and link equity from links pointing to the old URL. 

Why Is It Called a Slug?

The name “slug” has been used in journalism. It refers to the practice of using short descriptions of articles for internal purposes.

Next Steps

Now that you know what a URL slug is and how to create or change one, you may want to check out our on-page SEO guide and look at other on-page SEO aspects that can improve your rankings.

Also, our Site Audit tool can help you identify and fix many common problems with URLs, such as:

  • Use of underscores in URLs
  • Too many parameters in URLs
  • URLs that are too long
site audit tool

All you need to do is to create a free account and run your first audit!





Read More

Leave a Reply