URL Slugs: How to Write Clean, Stable, Search-Friendly URLs
What makes a good slug, why hyphens beat underscores, how to handle accents and stop words, and why changing a published slug costs more than you think.
A slug is the readable part of a URL that identifies a page: the how-to-write-better-urls in example.com/blog/how-to-write-better-urls. It is a small detail that affects how people perceive a link, how search engines understand a page, and how much work you create for yourself when content changes.
This guide covers what makes a good slug, the hyphen versus underscore question, how to handle accents and stop words, and why stability matters more than anything else. The URL Slug Generator does the mechanical conversion.
Where the word comes from
"Slug" is newspaper jargon. In a newsroom, a story was given a short working name, its slug, that identified it as it moved from reporter to editor to typesetter. Content management systems borrowed the term in the early 2000s for the human-readable identifier in a page's URL, and WordPress made it familiar to everyone who has published on the web.
What a good slug looks like
| Slug | Verdict |
|---|---|
/blog/url-slug-guide | Short, descriptive, readable |
/blog/the-ultimate-complete-guide-to-url-slugs-in-2026 | Too long, will date |
/blog/post?id=8812 | Says nothing to a human |
/blog/URL_Slug_Guide | Mixed case and underscores |
/blog/url%20slug%20guide | Spaces were never converted |
The common rules:
- Lower case. URL paths are case-sensitive on most servers, so
/Aboutand/aboutcan be two different pages. Lower case avoids duplicates and confusion. - Hyphens between words.
- Only letters, digits and hyphens. No spaces, punctuation or symbols that need percent-encoding.
- Short and descriptive. Three to six meaningful words is a good target.
- No dates or version numbers unless they are essential.
/pricingoutlives/pricing-2026.
Hyphens or underscores?
Google's URL structure guidance recommends hyphens rather than underscores to separate words in URLs, because hyphens are treated as word separators. There is a usability reason too: when links are underlined, underscores disappear into the underline and url_slug_guide looks like url slug guide with mysterious gaps.
Underscores and dots are still occasionally useful, for example matching an existing file naming scheme, which is why the generator offers them as options. For new public URLs, use hyphens.
Accents and non-Latin text
Turning "Café Crème Brûlée" into a slug raises a question: what happens to the accents? The common approach, and what the RedBison generator does, is Unicode normalization (NFD), which separates letters from their accent marks, followed by removing the marks. "Café" becomes "cafe".
Text in non-Latin scripts is harder. Modern browsers and search engines support internationalized URLs, and a Japanese site may reasonably use Japanese characters in its slugs. They are percent-encoded on the wire and look long when copied into plain text. Many sites transliterate instead, turning Cyrillic or Greek into Latin letters. The RedBison generator keeps ASCII letters and digits only, so for non-Latin titles, write or transliterate the slug yourself.
Stop words
Stop words are short, common words such as "a", "the", "and", "of" and "to". Removing them shortens slugs: "The Complete Guide to URL Slugs" can become complete-guide-url-slugs.
It is a judgment call, not a rule. Removing stop words sometimes changes meaning or makes the slug read awkwardly; how-write-better-urls reads worse than how-to-write-better-urls. The generator leaves them in by default and lets you turn removal on when it helps.
Length
There is no hard limit that matters in practice; browsers handle URLs of thousands of characters. Shorter slugs are easier to read, share and remember, and they are less likely to be truncated in search results or chat previews. The generator's maximum length option trims at a word boundary, and you can set it to 0 for no limit.
Stability beats everything
The most important property of a slug is that it does not change. Once a URL is published, it gets linked from other sites, bookmarked, shared in chat and indexed by search engines. Changing it breaks all of those unless you add a permanent redirect.
If you must change a slug:
- Add a 301 (permanent) redirect from the old URL to the new one.
- Update internal links to point directly at the new URL.
- Update the canonical tag and sitemap.
- Keep the redirect indefinitely.
Google has said that 301 redirects pass ranking signals, but redirects add a hop for users and complexity for you. The cheapest redirect is the one you never need, which is why it pays to choose a durable slug at the start.
Some sites put a numeric ID in the URL alongside the slug, as in /questions/12345/how-to-x, and look pages up by ID. That lets them change the slug freely and redirect old versions automatically, at the cost of a less tidy URL.
Slugs and SEO, honestly
A descriptive slug is a small, helpful signal. It tells users and search engines what a page is about, and when the URL is shown in results or pasted somewhere without a title, readable words make it more likely to be clicked. It is not a ranking shortcut. Stuffing keywords into slugs does not help, and a clear, short slug always beats a long keyword-laden one.
A quick checklist
- Lower case, hyphen-separated, ASCII letters and digits.
- Describes the page in a few words.
- No dates, IDs or temporary words unless needed.
- Unique within its section.
- Will not need to change when the content is updated.
Related tools
- Case Converter for other naming styles
- Base64, URL and HTML encoder to see how unconverted characters get percent-encoded
- QR Code Generator, where short URLs make simpler codes