Guide

What Is a URL Slug? (And How to Write a Good One)

The slug is the last part of a web address that names the page — like how-to-tip in /guides/how-to-tip. A good slug tells people and search engines what the page is about before they click.

Where the slug lives

In https://example.com/blog/better-sleep-tips, the slug is better-sleep-tips. Blogs, shops and content systems usually create it from the page title.

The rules for a clean slug

Most sites follow the same conventions:

  • Lowercase letters only
  • Hyphens between words — no spaces or underscores
  • Remove punctuation like !, ?, & and quotes
  • Turn accented letters into plain ones (café → cafe)
  • No hyphens at the start or end

Worked example

The title "10 Tips for Better Sleep in 2026!" becomes 10-tips-for-better-sleep-in-2026. The exclamation mark is dropped, and every run of spaces or symbols becomes a single hyphen.

Why slugs matter for SEO

A readable slug looks trustworthy in search results and links, and including the main topic words gives search engines a small extra clue. Shorter is usually better — you can drop filler words like 'the' or 'a' by hand.

Avoid changing a slug after a page is published. If you must, set up a redirect from the old address so links and rankings aren't lost.

Generating one instantly

Paste a title into the slug generator and it applies all the rules above as you type, then shows a preview URL you can copy.

Try it yourself

Put this guide into practice with our free Slug Generator — no sign-up, no download.

Open the Slug Generator