How to Write SEO-Friendly URL Slugs
The "slug" is the human-readable part of a web address that identifies a specific page — the bit after your domain, like /how-to-write-slugs. It's a small detail that quietly affects both search rankings and how much people trust your links. This guide covers what a good slug looks like and the rules for writing one.
What a slug is and why it matters
Compare two links to the same article: /p?id=48213 versus /how-to-write-slugs. The second tells both the reader and the search engine exactly what the page is about before they even click. Clean slugs improve click-through rates because they look trustworthy in search results and when shared, and they give search engines another clear signal about the page's topic. They also make your links easier to say out loud and remember.
The rules of a good slug
- Use hyphens, not underscores or spaces. Search engines treat hyphens as word separators but read underscores as joining words together. Spaces aren't allowed and get encoded into ugly "%20" sequences.
- Keep it lowercase. Some servers treat "/About" and "/about" as different pages, which can split your traffic and cause duplicate-content issues. Lowercase avoids the whole problem.
- Keep it short and meaningful. Include the key words that describe the page, and cut filler like "a", "the" and "and" where it doesn't hurt readability. Short slugs are easier to read and share.
- Strip accents and special characters. Convert "café" to "cafe" and remove punctuation. This keeps the URL clean and universally readable across systems.
- Match the content, not the date. Avoid baking dates or category numbers into the slug unless they're genuinely useful — they make links look stale and break if you reorganise.
A worked example
Suppose your article is titled "10 Amazing Tips for Café Owners in 2026!". A weak slug would keep everything: /10-amazing-tips-for-café-owners-in-2026! — it has an accent, an exclamation mark, and filler words. A strong slug distils it to the essentials: /tips-for-cafe-owners. It's lowercase, hyphenated, accent-free, punctuation-free and focused on the words that matter.
Don't change slugs casually
Once a page is published and links point to it, changing its slug breaks those links and can lose the search ranking it built up. If you must change a slug, set up a redirect from the old address to the new one so visitors and search engines are forwarded automatically. The best approach is to get the slug right the first time.
Generating slugs consistently
Doing all this by hand for every page is tedious and error-prone. Our slug generator applies these rules automatically: it lowercases the text, strips accents and punctuation, and joins words with hyphens, giving you a clean slug you can paste straight into your CMS. If you just need to fix capitalisation elsewhere, the case converter handles that too. Everything runs in your browser.
Key takeaways
- A good slug is lowercase, hyphenated, short, accent-free and descriptive.
- Hyphens beat underscores; search engines treat them as word breaks.
- Get the slug right before publishing, and use redirects if you ever must change it.