Home  /  Guides  /  URL slug generator

URL Slug Generator for SEO: How to Write Slugs Google Understands

Updated 2026-10-13  ·  8 min read

The slug is the last part of a URL, the only piece a human will read, and the only piece that is entirely under your control. It is also the piece people change on a whim two years later and then wonder why their traffic dropped. This guide covers the rules that survive contact with reality, what slugs actually influence, and how to get them right the first time.

Advertisement

What a slug is

In https://example.com/blog/how-to-write-a-slug/ the slug is how-to-write-a-slug. It is the human readable identifier for the page, and it should describe the page rather than the date, the author or an internal job number.

Because paths build on each other, slugs sit inside a hierarchy: /blog/ for articles, /tools/ for utilities, /category/ for archives. Decide that structure early, because moving pages between folders later is expensive.

The rules that hold up

None of these are stylistic preferences. Each one has a mechanical reason behind it.

  • Lowercase everything, because URL paths are case sensitive on many servers and uppercase invites duplicate content problems
  • Separate words with hyphens rather than underscores. Search engines read a hyphen as a word separator and an underscore as a joiner
  • Drop articles and filler where the meaning survives, so this-is-the-best-way becomes best-way
  • Remove punctuation rather than encoding it, and transliterate accents so cafe stays cafe instead of a percent encoded string
  • Aim for three to five words. There is no penalty for length, but long slugs get truncated and look unreliable when shared
  • Leave dates out of evergreen content. A year in the URL means either updating the address every January or publishing a page that visibly ages

Do keywords in the URL still matter?

Search engines have been consistent on this for years: words in a URL are a very weak signal, and most of the benefit people measure is correlation rather than causation. Pages about slugs rank for slug related terms partly because their address contains the term, which is circular.

Three genuine benefits remain, and they are reasons enough to bother. The URL appears in search results, so it influences whether people click. It appears when the page is shared, so it influences whether people trust the link. And a descriptive slug makes your own site easier to navigate a year later.

Where people go wrong is stuffing. A slug like best-cheap-free-online-word-counter-tool reads worse than word-counter and offers nothing extra, because it looks like spam to the humans who matter.

The redirect trap

Changing a slug after publication breaks the old address. You must add a permanent redirect from the old URL to the new one, and even then you lose some of what the page had earned along with the links and shares pointing at the old address.

Some of that returns over time, but the safest policy is to treat the slug as permanent from the moment you publish. Which means the right moment to get it right is before you hit publish, not after.

Generating slugs in one step

The mechanical part, lowercasing, stripping punctuation, replacing spaces with hyphens and transliterating accents, is exactly what a generator is for. The judgement part, choosing which words survive, is still yours.

Patterns that work by content type

A handful of shapes cover almost every page you are likely to build.

  • Article - /blog/topic-of-the-post/
  • Tool or utility - /tool-name/ at the root, with no folder, since these are the pages you most want short
  • Category archive - /category/name/
  • Comparison or review - /product-a-vs-product-b/
  • Localised content - the language code as the first segment, /es/ or /de/, not as a suffix

Frequently asked questions

Should URL slugs use hyphens or underscores?
Use hyphens. A hyphen is read as a word separator, so word-counter reads as two words. Underscores have historically been treated as joiners, so word_counter can read as one.
Do I need to change my slug to rank better?
Rarely, and the change carries risk. If a page already ranks and converts, leave the slug alone. Change it only when the current slug is misleading, and add a redirect the same day.
How long should a URL slug be?
Three to five words is a good target. There is no length penalty, but long slugs get truncated in search results and look untrustworthy when shared.
Are numbers or dates in a slug harmful?
Numbers are fine when they carry meaning, as in how-to-save-1000-a-month. Dates hurt evergreen content, because the address becomes visibly stale while the page is still accurate.