The slug is the readable part of a URL that identifies a page — the `url-slug-best-practices` in this page's address.
It has to survive being typed, copied, pasted into a chat, printed on paper, and read aloud. That rules out spaces, most punctuation, and anything needing percent-encoding. It is also the part of a URL a person actually reads before deciding whether to click.
Hyphens, not underscores
Google has been explicit about this: hyphens are word separators, underscores are word joiners.
/my-great-article → read as three words
/my_great_article → read as one tokenMatching those individual words is how the URL contributes to relevance at all. Underscores forfeit that.
Underscores still belong in filenames, database identifiers, and anywhere the value doubles as a code identifier. For public URLs, use hyphens.
Accented characters
Two wrong approaches and one right one.
Leaving them in produces percent-encoding when the URL is copied: `/café` becomes `/caf%C3%A9`, which is ugly in a search result and breaks when pasted into systems that mishandle encoding.
Deleting them loses meaning: `café` becomes `caf`.
Transliterating is correct: `café` becomes `cafe`, `Münchén` becomes `munchen`. The word stays readable and the URL stays ASCII. The slug generator does this by decomposing accented characters and stripping the diacritical marks.
| Title | Slug |
|---|---|
| Café Münchén: 10 Best Résumé Tips! | `cafe-munchen-10-best-resume-tips` |
| How to Convert HEIC to JPG (2026) | `how-to-convert-heic-to-jpg-2026` |
| Understanding React's useEffect Hook | `understanding-reacts-useeffect-hook` |
| C++ vs Rust: Which Is Faster? | `c-vs-rust-which-is-faster` ← problem |
That last row shows the limit. Stripping non-alphanumeric characters destroys `C++`, and `C#` and `C` collapse to the same slug. For programming topics, write the slug by hand: `c-plus-plus-vs-rust`.
Never change a published slug
This is the expensive mistake.
Changing a slug breaks the old URL. Every inbound link, every bookmark, every share in a chat history, and every search result pointing at the old address now returns a 404. You lose the traffic and the accumulated ranking signals along with it.
If you genuinely must change one, add a 301 redirect from the old slug to the new one and keep it permanently. A 301 passes the ranking signal along; a 404 discards it.
The corollary is to choose slugs that will not need changing:
- Avoid years unless the content is genuinely year-specific. `/guide-to-x` outlives `/2026-guide-to-x`.
- Avoid ordinal numbers. `/10-best-tools` needs a rewrite when you add an eleventh.
- Avoid transient qualifiers like `new`, `updated`, or `latest`.
Length
Three to six meaningful words is a good target. There is no ranking penalty for length itself, but long slugs get truncated in search results and are awkward to share.
Drop stop words where they add nothing:
how-to-convert-a-heic-file-to-a-jpg-file-on-windows (too long)
convert-heic-to-jpg-windows (better)Keep them where removing them changes the meaning or makes it read oddly.
Common mistakes
- Letting two titles collide. "React Hooks" and "React hooks!" slugify identically. Check for collisions before saving rather than silently overwriting.
- Mixed case. Many servers treat URLs as case-sensitive, so `/My-Post` and `/my-post` become two pages with the same content. Generate lowercase, always.
- Keyword stuffing. Ten hyphenated keywords reads as spam to humans and does not help rankings.
- Including the category twice. `/blog/blog-post-about-x` repeats what the path already says.
- Trailing-slash inconsistency. Pick one form and redirect the other, or you have duplicate URLs.
Frequently asked questions
Do slugs affect rankings?
Mildly and directly, as a relevance signal. The larger effect is on click-through: a readable URL in a search result gets clicked more often than an opaque one.
Should the slug match the title exactly?
It should match the meaning. Trimming a long title to its core words is usually better than transcribing it in full.
What about non-Latin languages?
Modern browsers display Unicode URLs correctly, and for a non-English audience a native-script slug is often the better choice. The slug generator preserves letters from any script; it does not romanise them.
Numbers in slugs?
Fine when meaningful (`heic-to-jpg-2026` for genuinely year-specific content). Avoid as list counts.
How do I bulk-generate slugs?
Paste one title per line into the [slug generator](/slug-generator) — each line converts independently.
Related reading
If your titles came from a spreadsheet with inconsistent casing, run them through the case converter first. For checking a title against a meta-title character limit, the word counter gives live counts. When a slug becomes a query parameter rather than a path segment, the URL encoder handles the encoding.