How to Create SEO-Friendly URL Slugs: Rules, Examples, and a Free Generator
A URL slug is the part of a web address that identifies a specific page in a human-readable way. In the URL https://example.com/blog/how-to-create-url-slugs, the slug is how-to-create-url-slugs. Getting slugs right matters for both SEO and user experience.
What makes a good URL slug?
A good URL slug is:
- Short — ideally under 60 characters, though Google does not have an official limit
- Descriptive — reflects the actual content of the page
- Lowercase — URLs are case-sensitive on most servers; lowercase prevents duplicate content issues
- Hyphenated — hyphens separate words. Google explicitly recommends hyphens over underscores for word separation
- Keyword-containing — includes the primary keyword the page targets
- Free of stop words — articles and prepositions (a, an, the, of, in) are often removed to keep slugs concise
Hyphens vs underscores — does it matter?
Yes. Google has stated that it treats hyphens as word separators (so word-count is read as "word count") but treats underscores as part of the word (so word_count is read as "wordcount"). For SEO, always use hyphens in URL slugs. Underscores are appropriate for variable names in code but not for URLs.
What to include in a slug
- The primary keyword phrase for the page
- The most descriptive words from the page title
Example: Page title "How to Create a QR Code for Your Business in 2026" → slug: create-qr-code-business
What to remove from a slug
- Stop words: a, an, the, and, or, but, in, on, at, to, for, of, with, by
- Special characters: punctuation, parentheses, quote marks, emoji
- Dates and year numbers (unless the content is specifically dated)
- Duplicate information already in the URL path
Handling accented characters
Characters like é, ñ, ü, ç must be converted to ASCII equivalents (e, n, u, c) before being used in a slug. Technically, non-ASCII characters are percent-encoded in URLs (%C3%A9 for é), which is ugly and error-prone. Always use ASCII slugs.
Changing slugs after publish
Avoid changing slugs on published pages — every external link and indexed URL becomes a 404 error. If you must change a slug, set up a 301 permanent redirect from the old URL to the new one. This passes approximately 90–99% of the old page's search ranking to the new URL.
Frequently asked questions
Should I include dates in URL slugs?
Only for genuinely time-bound content like news articles or annual reports. For evergreen content like "how to" guides and tutorials, avoid dates — the slug ages poorly and a URL showing "/2024/" signals dated content to users finding it in 2026.
How long should a URL slug be?
Google displays approximately 60 characters in search result URLs before truncating. Shorter is better — 3 to 5 words is the practical optimum for most pages. The primary keyword should be within the first few words.
Does the slug affect SEO ranking?
The slug is a minor ranking factor. It signals to search engines and users what the page is about. More importantly, a clean descriptive slug improves click-through rate in search results, which does affect ranking indirectly.