Guides

What Is a URL Slug? A Plain-English Guide

Marcus Brennanยทยท6 min read

A colleague once shared a link to what he swore was a brilliant article, and the URL ended in /?p=4471. I clicked it because I trusted him, not because I had the faintest idea what was on the other side. A week later he sent another: /how-to-run-a-retro-that-people-dont-hate. I knew what that one was before I clicked, and I actually saved it. Same person, same blog. The only difference was the slug.

That readable tail of a web address has a name, and it quietly does more work than most people realize. Let me walk through what it is and how to make a good one.

What a slug actually is

A URL slug is the part of a web address that identifies one specific page in human-readable words โ€” normally the last segment after the final slash. In codeutilitykit.com/what-is-a-url-slug, the slug is what-is-a-url-slug. It's the label on the page, written for people.

The name comes from newspapers, where a 'slug' was the short nickname editors gave a story while it moved through production. Same instinct here: a page has a formal title, and it has a short, sluggable handle you use to point at it.

Why not just use the ID?

Under the hood, every page already has a unique identifier โ€” a database row number like 4471. The site could serve pages at /?p=4471 and function perfectly. So why bother with words?

Because 4471 is a legal name and how-to-run-a-retro is a nickname, and humans run on nicknames. Think about the difference between being introduced to 'employee 4471' versus 'Priya from design.' Both identify one person unambiguously. Only one tells you anything, sticks in memory, or survives being read aloud. A slug is the nickname: it tells a reader (and a search engine crawling the link) what the page is about before anyone opens it.

That preview matters in more places than you'd guess โ€” a link shared in chat, a result in Google, a bookmark you scan six months later. Readable slugs are quietly persuasive in every one of them.

What makes a good slug

The rules are few and they all follow from 'readable and stable':

  • Lowercase everything. Some servers treat /Page and /page as different URLs; lowercase sidesteps the whole mess. If you're normalizing case across a batch of titles, a Text Case Converter does it in one pass.
  • Hyphens between words, never underscores or spaces. Search engines read a hyphen as a word break, so url-slug is two words to them. An underscore joins, so url_slug can read as one. And a literal space isn't even allowed โ€” it gets encoded into %20, turning a clean address into my%20great%20post.
  • Drop the filler. Strip stop words (a, the, of, and), punctuation, and accents. how-to-tie-a-tie beats how-to-tie-a-tie-the-complete-guide-for-2026.
  • Keep the keyword, keep it short. Include the term the page is really about, then stop. A few meaningful words is the target, not the entire headline.

Doing all of that by hand โ€” lowercasing, swapping spaces for hyphens, transliterating an accented รฉ to e, dropping stray punctuation โ€” is fiddly and easy to get subtly wrong. A Slug Generator takes a title and applies every rule at once, which is why it's the tool worth reaching for rather than hand-editing. Once the slug is set, the Meta Tag Generator helps you line up the title and description that show alongside it in search results.

The one rule people break: don't change a live slug

Here's the lesson that costs teams real traffic. A slug isn't just a label โ€” it is the address. Change what-is-a-url-slug to url-slug-explained and you haven't renamed a page; you've created a new URL and deleted the old one. Every link, bookmark, and hard-won search ranking pointing at the old slug now lands on a 404.

So treat a published slug as close to permanent. Get it right before you publish โ€” this is where a moment with a slug generator pays off โ€” and if you genuinely must change it later, set up a 301 redirect from the old address to the new one so the accumulated value carries over. Changing slugs casually is one of the quietest ways to bleed traffic a page already earned.

The one-line version

A URL slug is the readable, hyphenated, lowercase handle at the end of a web address that names a page for humans and search engines alike โ€” worth getting right, and worth leaving alone once it ranks. Turn any title into a clean one with the Slug Generator, and if you're tuning a page for search, the same care that produces a good slug applies to its whole footprint โ€” see what Domain Rating is for how authority stacks on top of on-page basics like this.

Try the tools

Frequently Asked Questions

What is a URL slug?

The readable, unique part of a URL that names a specific page โ€” usually the last segment after the final slash. In `blog.example.com/how-to-tie-a-tie`, the slug is `how-to-tie-a-tie`. It replaces a cryptic database ID with words a human can actually read.

What makes a good URL slug?

Short, lowercase, words separated by hyphens, built from the page's main keywords, with stop words (a, the, of) and punctuation stripped out. Aim for a few meaningful words rather than the whole page title.

Should a slug use hyphens or underscores?

Hyphens. Search engines read a hyphen as a space between words but treat an underscore as a joiner, so `word_count` can be read as one token while `word-count` is read as two. Hyphens are the web standard for slugs.

Does the URL slug affect SEO?

Modestly but genuinely. A descriptive slug containing the target keyword gives search engines and users a clear signal of the page's topic and makes a cleaner, more clickable link. It won't outrank strong content on its own, but it's an easy on-page win.

Can I change a slug after publishing?

You can, but a new slug is a new URL. If the page has any traffic or backlinks, add a 301 redirect from the old slug to the new one so you keep the rankings and don't leave a dead link behind.

MB

Marcus Brennan writes for CodeUtilityKit, where the team builds free, privacy-first developer tools that run entirely in your browser. Every guide is written and reviewed by developers who use these tools daily.