Slug Generator: Clean URLs, Transliteration and What to Avoid
Table of Contents
What a Slug Is and Why It Matters
A slug is the human readable part of a URL that identifies a page. In example.com/blog/how-to-bake-bread the slug is how-to-bake-bread. The name comes from newspaper production, where a slug was the short label a story travelled under.
It has to survive being typed, pasted, printed and read aloud, which rules out spaces, accents, punctuation and anything requiring percent encoding. What remains is lowercase letters, digits and a separator.
Descriptive slugs help people more than machines. Search engines have long since stopped rewarding keywords in the URL directly, but a clear slug tells a reader what they will get before they click, and it survives being shared without context.
Slugs must be unique within their path. Most systems append a number or a short identifier when a collision occurs, which is worth planning for rather than discovering.
Accents, ł, ß and Cyrillic
Most accents come off mechanically. Unicode normalisation splits é into e plus a combining acute accent, and dropping the accent leaves a plain e. That single step handles French, Spanish, Portuguese and most of Central Europe.
Some letters are not decomposable. Polish ł, German ß, Danish and Norwegian ø, Icelandic þ and ð are distinct letters rather than accented ones, so normalisation leaves them untouched and they need an explicit mapping. Without one they are simply deleted, which turns Łódź into d.
ß becomes ss rather than s, which matches German convention and keeps the word recognisable.
Cyrillic is transliterated character by character using a common scheme, so ж becomes zh and щ becomes shch. Several competing standards exist and none is universally correct, so pick one and apply it consistently rather than mixing.
Hyphens Against Underscores
Use hyphens. Search engines have treated a hyphen as a word separator and an underscore as a word joiner for many years, so red_car reads as one token and red-car reads as two.
Hyphens survive display better too. An underscore frequently disappears under the underline that browsers and chat clients apply to links, which makes a URL impossible to read aloud or retype.
Underscores still have their place in filenames, in code and in systems that treat hyphens specially. That is why the option exists, not because it is a good URL choice.
How Long Should a Slug Be
Three to six words is the usual advice, which lands somewhere between twenty and sixty characters. Long enough to be descriptive, short enough to read in a search result without truncation.
Search results truncate the visible URL, so anything past roughly sixty characters is unlikely to be seen even when it is indexed.
Trim at a word boundary. Cutting to an exact character count leaves slugs ending mid word, which looks broken. This tool moves the cut back to the last separator unless doing so would lose more than half the slug.
Dates in slugs age badly. Including 2026 in a URL makes the article look stale in 2027 and forces either a redirect or a lie when you update it.
Removing Stop Words
It shortens slugs and occasionally hurts them. Dropping a, the, of and and tightens a long title, but it can also change the meaning or make the slug hard to read.
Some titles depend on their stop words. The Who, To Kill a Mockingbird and anything with a preposition carrying real meaning will read badly without them.
The safeguard here is that a slug is never emptied. If every word is a stop word they are all kept, since a slug of nothing is worse than a long one.
Leave it off unless slugs are genuinely too long. The benefit is cosmetic and the risk is a slug nobody can read.
Never Change a Published Slug
A URL is a promise. Once a page is live, every link, bookmark, share and search result points at that address. Changing it breaks all of them at once.
If you must change it, redirect. A permanent redirect from the old slug to the new one preserves both the traffic and the ranking signals, and it costs almost nothing to set up.
Keep redirects forever. Removing one years later still breaks whatever links remain, and old links have a habit of outlasting the site that created them.
This is why slugs should not contain volatile detail. A version number, a year or a price in the URL guarantees a future rename.
When Non Latin URLs Are Fine
Browsers handle them properly now. A URL containing Cyrillic, Greek or Chinese characters is percent encoded on the wire but displayed correctly in the address bar, and search engines index it without difficulty.
The problems come from everything else. Analytics tools, spreadsheets, chat clients and older systems frequently show the percent encoded form, which is unreadable and considerably longer.
For a single language audience it can be the right call. A Russian site for Russian readers loses nothing by using Cyrillic slugs. For anything international, transliteration remains the safer default.
Frequently Asked Questions
Before publishing: Check the slug is unique within its path and that you are happy to keep it. Changing a live URL breaks every link pointing at it unless you add a permanent redirect and keep it indefinitely.