What Is a URL Slug? 9 Best Practices for SEO

URL slugs help Google better understand what your pages are about and are considered a small ranking factor. Clean URL slugs are also helpful for readers navigating your website.

January 15, 2024
Written by
Lizzie Davey
Reviewed by
Nate Matherson

Join 2,500+ SEO and marketing professionals staying up-to-date with Positional's weekly newsletter.

* indicates required

Google has indexed about 50 billion webpages. That’s a lot of pages to organize, crawl, and understand. This is where URL slugs come into play: Google uses URL slugs — the last part of a webpage’s URL address — to differentiate pages from one another. URL slugs are an important search engine ranking factor because they provide information about a webpage’s contents and enhance the user experience.

“We use the words in a URL as a very, very lightweight ranking factor,” says John Mueller. He adds that Google uses the URL slug to assign context to a webpage when the search engine can’t access the body content.

What Is a URL Slug?

A URL slug is the end of a URL — the part after the final backslash (/). A good URL slug is descriptive and explains the page’s content. For example, the URL slug for the page below is “keyword-search-volume.”

Don’t confuse the URL slug with the URL address or permalink:

  • URL address: the entire web address of a page (“positional.com/blog/keyword-search-volume”)
  • URL slug: the part of the URL after the final backslash (“keyword-search-volume”)

By default, many CMS platforms, such as WordPress, add a string of letters and numbers as a URL slug, but this doesn’t provide Google or **readers with much context. URL slugs should be short and self-explanatory, and they should provide an overview of a page’s content.

  • Good URL slug: “content-gap-analysis”
  • Bad URL slug: “how-to-do-content-gap-analysis-in-7-easy-steps”
  • Good URL slug: “core-web-vitals”
  • Bad URL slug: “**p=4573” (an example of a default slug generated in WordPress)

Why Is It Called a Slug?

The word “slug” originated in journalism, where a “slug” is a short name given to an article as it makes its way through the editorial process. The term caught on among developers, and it’s now used to refer to the descriptive part of a webpage’s URL address.

Why URL Slugs Are Important for SEO

There are two key reasons URL slugs impact your search rankings.

First, Google looks at a slug as a unique identifier that explains what a page is about. You can include the page’s primary keyword as one way to indicate a page’s topic. As John Mueller noted, Google uses the URL slug to understand a page. But while they help search engines understand a page’s content, slugs aren’t as big of a ranking factor as page speed, optimized content, and user experience.

Second, URL slugs enhance the user experience by providing extra information about a page. Using the target keyword in a URL slug helps readers determine whether the page is relevant (or, at the very least, lets them know what they’re actually clicking through into).

Which URL are you most likely to click on — ”example.com/marketing-tips” or “example.com/p=2343”?

Most searchers would choose the first URL because it’s far more descriptive.

Consistent URL slugs also create a crawlable site structure, which makes it easier for Google to index your website.

9 Best Practices for Writing SEO-Friendly URL Slugs

1. Be Descriptive and Target Your Primary Keyword

Use your URL slug to describe the content on a webpage. The easiest way to do this is to include your primary keyword, as it describes the content’s overarching topic. The key is to find the fine line between providing enough information and keeping your URL short and sweet.

This URL slug from Ahrefs targets the primary keyword “301-redirects.”

2. Keep Your Slugs Short

URLs that are too long get truncated in search results. This isn’t a total disaster, but it can affect click-through rates and make your listings look messy. Excessively long URLs can damage your visibility in SERPs (search engine results pages). Studies have found that shorter URLs tend to perform better in Google, with top-spot URL slugs averaging around 17 characters.

You can keep your slugs short by avoiding filler words (such as “ultimate-guide”) and function words (such as “a,” “the,” and “and”).

The URL slug below is just two words (16 characters) long..

3. Don’t Use Random Strings of Numbers

The default slug format in many CMS platforms is a random string of numbers. For example, if you create a webpage in WordPress, you’ll end up with a URL that looks something like “http://webpage.com/p=23412” — which doesn’t look very inviting. Most CMS platforms allow you to manually edit your URL slugs, and you should do so.

The post below has a long string of numbers at the end of the URL slug.

4. Avoid Dates and Numbers

If you’ve written an article titled “The 7 Best Email Marketing Tactics in 2024,” it’s only natural to want to include the numbers and dates in your URL slug. But hold up. If you update the number of tips or refresh the post later on, you’ll need to change the slug. This means that all the incoming links you have to that page will no longer be valid and you’ll lose all your well-earned link juice (unless you create redirects — more on this later).

Instead, use only letters in your slugs and avoid including dates.

Anchoring a URL slug with a date can make it go out-of-date quickly — Mediatool will have to update this slug every year:

5. Separate Words With Hyphens

Hyphens help break up your URL slugs and increase their readability.

Compare these two slugs: “best-italy-travel-tips” and “bestitalytraveltips.”

The hyphens between the words make the first slug much easier to read.

The URL slug below is long, but each word is separated with a hyphen to make it more readable.

6. Don’t Use Underscores

While you should separate each word in your URL slugs, don’t use underscores to do it. Search engines can struggle to interpret separators that aren’t hyphens. Plus, underscores can make your URLs stand out for the wrong reasons.

  • Good URL slug: “email-marketing-strategy”
  • Bad URL slug: “email_marketing_strategy”

7. Use Lowercase Letters

URL slugs are case-sensitive, so choosing to capitalize or use lowercase letters can have a huge impact on your link-building efforts and overall search engine rankings. The common practice is to stick to lowercase letters, as this is the format the majority of website owners use when linking out.

“By definition, URLs are case-sensitive,” says Mueller. “So technically yes, these things matter. Search engines will try to crawl all variations of a URL they find, so this can make it a bit slower for them to find other useful content on your website.” When a search engine finds multiple versions of the same webpage, it has to decide which one to keep. “It doesn’t change ranking, but our systems might choose a URL that you wouldn’t have chosen.”

8. Avoid Special Characters

Google recommends avoiding any non-ASCII characters (non–American Standard Code for Information Interchange), such as symbols, accented letters, and emojis. This is because they can cause confusion and older browsers may not be able to follow links or load images.

9. Maintain Consistent Formatting Across Your Site

However you decide to present your URL slugs, make sure you keep them consistent sitewide. This helps create a logical site structure that Google can easily crawl and index. It also means search engines can understand how different pages relate to each other and their overall importance in the wider context of your website.

What to Do If You Change Your URL Slug

You can no longer access a page through its original URL if you change the slug. Let’s say you want to change “twitter-marketing-tips” to “x-marketing-tips,” to reflect the social media site’s new branding. As soon as the “x-marketing-tips” slug is activated, you won’t be able to navigate to the page by using the original “twitter-marketing-tips” URL.

That doesn’t mean you shouldn’t change the URL slug if it needs an update. But you should set up a 301 redirect from the old URL to the new one so that anyone trying to visit your page that had the slug “twitter-marketing-tips” will be automatically redirected to the right page. This stops visitors from ending up on a 404 error page or the potential loss of traffic and link juice.

Final Thoughts

URL slugs are often an afterthought, but they tell Google (and readers) a lot about your page content. They’re a great place to target your primary keyword and provide more information about what your webpages are about. The key is to ensure that your slugs are descriptive, short, and written in lowercase. Use hyphens to separate words, and maintain consistency across your website to create a logical site structure.

Lizzie Davey
Author

Lizzie is a freelance writer for B2B e-commerce and SaaS brands. Over the past ten years, she's written millions of words that have turned readers into customers and loyal fans. When she's not typing away at her desk in Brighton, she's creating resources for freelancers, practicing aerial silks, or hopping on a plane. Lizzie has worked with several fantastic content marketing teams, including those at Zapier, Shopify, and Klaviyo.

Read More

Looking to learn more? The below posts may be helpful for you to learn more about content marketing & SEO.