A slug is the part of a web address a human actually reads. It's small, it's easy to overlook, and it shows up in search results, shared links, emails, and browser history — which means it quietly works for or against every page you publish. Here's what a slug is, what a good one looks like, and how the tools you already use build them.
Break a URL into its parts — the full anatomy is worth a look in our URL anatomy guide — and the slug is the final segment: the readable name of the page itself.
https://example.com/blog/10-tips-for-better-photos/
The slug is 10-tips-for-better-photos. Everything before it is protocol, domain, and folder structure; the slug is the part that names the page. A slug can be anything the server can route — a number, a hash, a random string — but the useful kind is descriptive: lowercase words separated by hyphens.
The word comes from the newspaper era, where a "slug" was the short working title editors gave a story as it moved through the newsroom. The web kept the name and the job.
Four habits cover almost every situation:
/About and /about can be different pages. Lowercase everything and the problem never exists.So a title like 10 Tips for a Better Café Résumé in 2026! becomes 10-tips-for-a-better-cafe-resume-in-2026 — 40 characters, fully readable, and identical in every browser and email client. The slug generator does this conversion live as you type.
Under about 60 characters is the practical ceiling, and shorter is usually better. Search results truncate long URLs, chat apps and QR codes mangle them, and a long slug almost always means a long headline got pasted in whole. Compare:
| Slug | Characters | Verdict |
|---|---|---|
| best-coffee-grinders | 19 | Tight and descriptive |
| 10-tips-for-a-better-cafe-resume-in-2026 | 40 | Fine for an article |
| the-ultimate-guide-to-finding-the-best-coffee-grinders-for-your-home-in-2026 | 76 | Bloated — trim to best-home-coffee-grinders |
Note the fix for the last row: drop stopwords (the, to, for, your), keep the two or three words people actually search, and the slug carries more meaning in less than half the space.
Hyphens, for public URLs. Every major web framework agrees — WordPress's sanitize_title, Django's slugify, Laravel's Str::slug, and Rails's parameterize all produce hyphenated slugs by default — and Google has said for years that it treats hyphens as word separators. Underscores still have honest work in file names and internal wiki pages, where they sort and read well. But when a URL is meant to be seen, hyphenate it.
The rules differ just enough to matter when you're moving between tools:
| System | Default behavior | Length limit |
|---|---|---|
| WordPress | Lowercase, hyphens, most punctuation stripped | post_name column: 200 chars |
| Django | Lowercase, hyphens, non-ASCII dropped | SlugField: 50 chars by default |
| Laravel | Lowercase, accents transliterated, hyphens | Whatever your validation allows |
| Rails | Lowercase, hyphens via parameterize | Whatever your model allows |
| GitHub | Repo names keep case; letters, digits, . _ - allowed | 100 chars |
The near-universal pattern is lowercase-and-hyphenate. GitHub is the deliberate exception — repository names read as brand names, not page addresses, so casing survives.
Modestly, and mostly through relevance and click-through. A slug that matches the search phrase confirms, to the human scanning results, that the page is what they asked for. A URL stuffed with stopwords or, worse, a meaningless ID does the opposite. It's one of the few ranking-adjacent elements you fully control at publish time, which is why it's worth ten seconds — spin up the slug generator, pick the two or three words that matter, publish.
What slugs don't do is rescue content. The words in the slug echo the words on the page; they don't replace them. And once a page earns links, its slug becomes infrastructure: changing it requires a 301 redirect or every inbound link breaks.
Short list, no exceptions: spaces (become %20), accented characters (é becomes %C3%A9), apostrophes, ampersands, emoji, and dates in evergreen content. The date habit is sneaky — best-phone-2024 looks outdated the day a newer model ships, while best-phone keeps earning. Use dates only when the content is genuinely pinned to a moment, like a conference recap.
A slug is the name your page wears everywhere it travels. Keep it lowercase, hyphenated, three to five words, under 60 characters, and free of anything that percent-encodes. Generate it before you publish with the slug generator, pair it with clean meta tags, and check how it'll read in search with the SERP optimizer. The whole discipline takes less time than typing the title twice.
Accents stripped, symbols dropped, hyphenated — live as you type.
Slug Generator →The slug is the last, human-readable segment of a URL. In example.com/10-tips-for-better-photos, the slug is 10-tips-for-better-photos. It names the page in a way people and search engines can read, unlike an ID or a query string.
Hyphens. WordPress, Django, Laravel, and Rails all generate hyphenated slugs by default, and Google has long treated the hyphen as its preferred word separator in URLs. Underscores are best left to file names and wiki-internal pages.
Three to five words and roughly 60 characters or fewer. That is short enough to survive being truncated in search results and shared in chats, while still carrying the keywords that make the page findable.
Yes, but the old URL stops working the moment you do. Set up a 301 redirect from the old slug to the new one, or every inbound link, bookmark, and search listing that points at the old address will 404.