Blog post

What is a URL slug, and why does it matter for SEO?

Date of post

25 June 2024

Read time

6 mins
URL structure shown on a computer screen

Search engine optimisation (SEO) consists of dozens of moving parts. 

URL slugs are one of them. 

This post looks at everything there is to know about URL slugs – what they are, why they’re important, and how to optimise them.

Let’s jump into it.

What are URL slugs?

A URL slug is the latter portion of a web page’s URL (or web address).

URLs (uniform resource locators) tell browsers where to find a specific piece of content. They sometimes include parameters that tell browsers “how” to retrieve and present the information. 

What does a slug look like?

The slug follows a forward slash at the end of a website’s address. Note that this doesn’t include additional parameters and fragments, which are denoted by a question mark (“?”) and hash symbol (“#”), respectively. 

Screenshot that highlights where the URL slug is found

What is the purpose of a slug?

Descriptive URL slugs let users know what to expect from your web page. Keeping slugs short and simple will also help users remember where to go. 

URL slugs make it easy for website owners to plan and organise the site’s architecture, including its internal link structure. 

They also let search engine crawlers understand what your page is about during the indexation process. This will help increase your search engine rankings for relevant keywords. 

How to edit a URL slug

For the sake of this guide, let’s discuss how you can edit a slug in WordPress – considering it’s the biggest content management system (CMS) on the planet. 

You can easily set the URL slug when editing posts or pages. On the settings panel, switch to the ‘Post’ or ‘Page’ tab and go to the ‘Summary’ section. From there, click the auto-generated URL next to “URL” and edit the “Permalink” field. 

Screenshot showing where in WordPress post you can find and edit the permalink

You can also edit the URL slug of existing posts and pages through the “Quick Edit” feature. On the “All Posts” page, hover your mouse over the post you want to modify and click ‘Quick Edit.’

Screenshot showing where in quick edit you can find and edit the post's slug.

You’ll then be able to modify the slug directly. Just enter your desired slug below the post or page title field.

Screenshot showing where to modify your slug in quick edit on WordPress posts

When you’re done, click ‘Update’. 

WordPress also offers various options for modifying your site’s permalink structure, which includes your URL slug. You’ll find these options on your WordPress dashboard by going to ‘Settings’ and clicking ‘Permalinks.’

Screenshot that shows where to find permalinks in the settings of WordPress

Be sure not to use the “plain” or “numeric” options when setting your permalink structure. If you do this, WordPress won’t include the slug in your permalinks. 

Ideally, create a custom URL structure that contains each post’s category and slug. This will establish your site’s hierarchy for search engine crawlers. 

Changing the permalink structure in WordPress settings

How to optimise URL slugs for SEO

Now, getting to the good stuff: URL slugs are an essential part of on-page optimisation. They enable search engines to understand your site’s hierarchical structure and the topical relevance of each post. 

Follow these tips to maximise the benefits. 

1. Include target keywords

First and foremost, keywords in URL slugs work wonders – not just for SEO but also for user experience. 

One glance at the URL slug, and users should know whether they’re on the right page. 

Of course, including keywords in URL slugs also signals relevance in the eyes of search engines. That’s why most if not all, top results in any search query include keywords in their URLs. 

Screenshot showing the slugs on the first page of the search results for what is SEO

Tip: Rather than targeting broad keywords and plugging them into your slugs, aim for long-tail keywords more likely to match the user’s intent.

2. Keep URL slugs short

URL slugs are important for search engine rankings, and the shorter the slug, the better. 

Your readers will have a tough time remembering something long and drawn-out like “what-is-the-meaning-of-search-engine-optimisation” as opposed to something snappier like “what-is-seo” or “seo-definition.” 

Furthermore, shorter URLs also perform better than long URL slugs in terms of actual rankings. 

3. Avoid including dates

Dates in URLs mean little to both users and search engine crawlers. 

For users, they only mean extra things to remember. Your content will also date quite quickly. 

Take a look at these slugs:

  • on-page-seo-tutorial-2024
  • on-page-seo-tutorial

From a user’s perspective, both posts contain the same information. But by this time next year, one will look irrelevant.

It also means that when you come to update your posts (as you should do regularly), your slug will be out of step with the content. Sure, you can easily change your post’s URL anytime, but doing so will ruin your search engine rankings. 

4. Use lower case 

Believe it or not, URLs are case-sensitive. 

That’s why sticking to lowercase is an unwritten rule in the SEO community. Using uppercase letters can lead to 404 errors and duplicate content issues, especially if you have in-house or outsourced SEO team members who are used to using lowercase URLs.

Fortunately, if you’re using WordPress, all your URLs automatically transfer to lowercase. 

The same thing happens with other modern blogging tools and CMS. To be sure, avoid capitalising any part of your URLs.

5. Avoid non-ASCII 

While it’s technically possible to include non-ASCII characters (symbols, accented letters, etc) in URL slugs, doing so can cause a lot of issues.

Users who don’t have the proper non-ASCII package installed on their computers will not be able to read your slugs. Other website owners may also encounter problems when linking to your page.

To keep things consistent, use transliteration when optimising for keywords or names that include non-ASCII characters. This is the process of representing text or words in a different writing system, like “entree” instead of “entrée.” 

6. Align slugs with headlines

URL slugs are meant to be short but should also encapsulate your content’s value. For instance, words that describe a unique value proposition or a specific audience can land you more clicks on search engine results pages (SERPs). 

For example, rather than just using “gardening-tips,” GardenersWorld.com used a more descriptive but still keyword-optimised URL slug, “gardening-for-beginners-10-tips.” 

Example slug for a gardening website

7. Use hyphens 

Perhaps the only acceptable symbol you should include in your URL slugs is the hyphen (“-“). 

Use hyphens instead of spaces to prevent the unsightly “%20” placeholder in your permalinks. 

Do this not just for post URL slugs but also for categories, author pages, and other subfolders.

Your FAQs on URL slugs

Have we missed something? You might find the answer in these FAQs.

What is the maximum length of URL slugs?

A URL can be as long as 2,048 characters, but it’s definitely not recommended for readability and optimisation reasons. As a rule of thumb, try to keep your URL slugs three to five words long. 

What are the best tools for optimising URL slugs?

If you use a CMS platform like WordPress, chances are you don’t need another tool to edit and optimise your slugs. However, WordPress SEO plugins like Yoast have additional benefits, like keyword suggestions and readability scoring. 

Can I change URL slugs at any time?

Yes, you technically can change the URL of any page at any time, but doing so without a good reason can cause your site’s rankings to plummet. This is common with site migrations and extensive website redesigns. 

Next steps 

URL slug optimisation is an important part of every comprehensive SEO strategy. 

It may not be as important as content quality or link building. But in a competitive space like SEO, it pays to get even the tiniest details right.

If you have any questions about SEO, don’t hesitate to contact us. We’ll be right with you.

Post author

Tilly, a history graduate with a passion for trivia, excels in her weekly quiz league and has a strong background in SEO marketing. Outside of work, she stays fit at the gym and loves reading, often sharing book recommendations with the team.

More content like this

Get in touch with Marketing Labs®

Recent blog posts

Psst! Did you know we’ve got our very own podcast?