What is a URL slug, and what makes a good one?
The slug is the human-readable tail of a URL that identifies a single page. Good slugs are short, lowercase, hyphen-separated, and readable at a glance—in search results, shared links, and browser histories alike.
From headline to slug
Slug generation lowercases the text, folds accented characters to their base letters (café becomes cafe), strips punctuation, and joins the remaining words with a separator. Unicode normalization (NFKD) splits accented glyphs into a base character plus a combining mark, which can then be removed cleanly.
Words are usually joined with hyphens because Google treats them as word separators; underscores do not enjoy the same treatment.
Anatomy of a strong slug
Short, descriptive, stable.
| Quality | Weak | Strong |
|---|---|---|
| Descriptive | /p?id=8812 | /better-sleep-tips |
| Concise | /the-10-best-tips-for-getting-better-sleep-every-night | /10-tips-better-sleep |
| Stable | Slug rewritten on every title edit | Slug frozen after publish; titles may change |
Practical rules
Drop stop words when long
"A", "the", and "for" rarely add meaning. Trimming them keeps slugs readable without sacrificing keywords.
Slugs are permanent
Changing a published slug breaks inbound links. If you must change one, redirect the old URL permanently to the new address.
Fold non-ASCII characters
Percent-encoded URLs are ugly and error-prone in the wild. Folding diacritics produces clean ASCII that survives copy-paste everywhere.