← All guides

Web & APIs · 7 min read

URL Slugs and SEO-Friendly URLs

The slug is the human-readable part of a URL that identifies a page: in example.com/blog/how-to-brew-coffee, the slug is how-to-brew-coffee. Good slugs help people understand a link before they click it, make URLs easy to share and remember, and give search engines a small extra signal about the page. Bad ones — long, cryptic or constantly changing — work against all of that.

This guide explains what makes a good slug, how to generate them from titles, how to handle non-English text, and how to change URLs without losing traffic.

Try it yourself with the related tool.

Generate a slug →

Advertisement

What makes a good slug

A good slug is short, descriptive and readable: lower-case words separated by hyphens, containing the main topic of the page. /guides/password-hashing beats /guides/post?id=8812 and /guides/the-complete-ultimate-guide-to-everything-about-password-hashing-in-2025. Three to five meaningful words is usually enough. Leave out filler such as "a", "the" and "and" unless the slug reads badly without them.

Hyphens, case and characters

Use hyphens between words. Google has long recommended hyphens over underscores, which some systems treat as joining words together. Use lower case only: URLs are case-sensitive on most servers, so /About and /about can be different pages, causing duplicates and broken links. Avoid spaces, which become %20, and punctuation, which either gets encoded or breaks the link when people copy it into text.

Generating slugs from titles

A slug generator lower-cases the title, transliterates accented letters (é to e, ß to ss), replaces anything that is not a letter or digit with a hyphen, collapses repeated hyphens, and trims hyphens from both ends. "Café & Bar: 10 Tips!" becomes cafe-bar-10-tips. It should also guarantee uniqueness, usually by appending -2 when a slug already exists, and limit length. Review generated slugs for important pages by hand; automatic output is a starting point.

Non-Latin scripts

For languages written in other scripts — Arabic, Chinese, Japanese, Russian — you can either transliterate to Latin letters or keep the native script. Browsers display native-script URLs correctly in the address bar, and search engines handle them well, which makes them more readable for the intended audience. When copied into some apps they appear as long percent-encoded strings, though. Choose based on your audience, and be consistent across the site.

Leave dates and IDs out unless they matter

Dates in URLs, like /2021/03/guide, make evergreen content look stale and force a URL change if you update and republish. Use them only for genuinely time-bound content such as news. Numeric IDs are sometimes necessary for databases; a common compromise is /products/1234-blue-kettle, where the server looks up the ID and redirects if the slug part is wrong, so renaming a product never breaks links.

Changing a URL safely

Every URL that has been shared, bookmarked or indexed carries value. If you must change one, set up a permanent 301 redirect from the old URL to the new one, update internal links to point to the new URL directly, and update the sitemap. Avoid chains of redirects and never let the old URL return a 404. Search engines usually transfer rankings through a 301, but frequent URL changes still cause temporary drops, so get slugs right before publishing.

Trailing slashes and consistency

Decide whether URLs end with a slash — /guides/hashing/ or /guides/hashing — and redirect the other form to it. Search engines treat the two as different URLs, so serving both splits links and signals between duplicates. Apply the same rule to www versus the bare domain and to HTTP versus HTTPS, and make sure canonical tags, sitemaps and internal links all use the chosen form.

How much slugs matter for SEO

Slugs are a minor ranking factor at best; content quality and links matter far more. Their bigger effect is on people. A clear URL in a search result or a shared message tells readers what to expect, which improves click-through and trust. Keyword stuffing a slug does not help and makes it look spammy. Write slugs for humans, keep them stable, and the search engine benefits follow.

Related guides