What a slug is and what it does
A slug is the human-readable part of a URL that identifies a specific page — the how-to-build-a-website in example.com/blog/how-to-build-a-website.
Good slugs are lowercase, use hyphens between words, contain only URL-safe characters, and describe the content. They serve users, who can tell what a link points to before clicking, and search engines, which use them as a ranking signal and display them in results.
Why hyphens and not underscores
This is settled and worth knowing the reason for. Google's own guidance recommends hyphens, and has for many years, because hyphens are treated as word separators while underscores are treated as word joiners.
That means build_a_website may be read as a single token buildawebsite, while build-a-website is read as three words. Only the second matches a search for “build a website”.
There is also a visual argument: underscores can be obscured by the underline styling applied to links, making the URL harder to read.
How long a slug should be
Shorter is generally better, with 3 to 5 meaningful words a reasonable target. Search results truncate long URLs, and long slugs are harder to share, remember, and read.
The instinct to include every keyword is counterproductive. A slug like best-cheap-affordable-budget-laptops-under-500-2026-guide-review reads as spam to both users and ranking systems. best-budget-laptops is clearer and performs better.
Removing stop words — a, the, of, and — shortens slugs without losing meaning, though it is worth keeping them where removal changes the sense. state-of-the-art is not improved by becoming state-art.
Handling non-English characters
Accented and non-Latin characters need a decision. There are two approaches.
Transliteration converts to the nearest ASCII equivalent: café becomes cafe, München becomes muenchen or munchen. This produces short, universally compatible URLs and is what this tool does.
Percent-encoding preserves the original characters but produces long, unreadable URLs — a Cyrillic or Chinese slug can expand to several times its length. Browsers display these decoded, so users often see them correctly, but they are awkward when copied as raw text.
For sites serving a non-Latin-script audience, native-script slugs are increasingly common and generally handled well. For mixed or international audiences, transliteration remains the safer default.
The rule that matters most: do not change slugs
Once a URL is published, changing it breaks every existing link, discards accumulated ranking signals, and invalidates bookmarks and shares.
If a change is unavoidable, implement a 301 permanent redirect from the old URL to the new one. This preserves most ranking value and keeps existing links working. Keep the redirect in place indefinitely — removing it later reintroduces the breakage.
A related decision worth making early: whether to include dates or categories in URLs. /2024/03/my-post makes content look stale and makes reorganisation painful. A flat /my-post or a shallow /blog/my-post ages better and is easier to restructure.
Frequently asked questions
Should slugs use hyphens or underscores?
Hyphens. Search engines treat hyphens as word separators and underscores as word joiners, so build-a-website is read as three words while build_a_website may be read as one.
How long should a URL slug be?
Three to five meaningful words is a good target. Search results truncate long URLs, and keyword-stuffed slugs read as spam to both users and ranking systems.
Should I remove stop words from slugs?
Often yes, since it shortens the slug without losing meaning. Keep them where removal changes the sense - state-of-the-art should not become state-art.
Can I change a URL slug after publishing?
You can, but it breaks existing links and discards ranking signals. If you must, add a 301 permanent redirect from the old URL and keep it in place indefinitely.