The URL slug is one of the simplest SEO improvements you can make to any page. A clean, descriptive slug tells both users and search engines what the page is about before they even click. A messy, auto-generated slug like ?p=4821 or one stuffed with stop words like how-to-bake-a-really-good-loaf-of-sourdough-bread-at-home-in-your-kitchen both miss the mark.
This guide explains what a URL slug is, the rules for writing a good one, how to use the free URL Slug Generator tool, and best practices for WordPress, Next.js, and other CMS platforms.
Advertisement
What is a URL slug?
A URL slug is the human-readable part of a URL that identifies a specific page. In the URL:
https://example.com/blog/how-to-bake-sourdough-bread
The slug is how-to-bake-sourdough-bread.
Good slugs are lowercase, use hyphens to separate words, contain only letters, numbers, and hyphens, and describe the page content concisely. They are used by WordPress, Next.js, Shopify, Ghost, Webflow, and virtually every other CMS or framework.
Rules for a good URL slug
Lowercase only
how-to-bake-bread ✓ How-To-Bake-Bread ✗
Hyphens between words
how-to-bake-bread ✓ how_to_bake_bread ✗ howtobakebread ✗
No special characters
how-to-bake-bread ✓ how-to-bake-bread! ✗
Remove stop words when possible
bake-sourdough-bread ✓ how-to-bake-a-loaf-of-sourdough-bread ✗
Include target keyword
sourdough-bread-recipe ✓ post-4821 ✗
Keep it short — 3 to 5 words
sourdough-bread-recipe ✓ everything-you-need-to-know-about-making-sourdough-bread ✗
How to generate a URL slug online
Open the URL Slug Generator
Go to the free URL Slug Generator — no sign-up needed.
Enter your title
Type or paste the page title, post heading, or product name you want to convert. The tool accepts any text including accented characters, which are transliterated (é → e, ñ → n).
Review the output
The generated slug is shown immediately: lowercase, hyphens replacing spaces, special characters removed. Review it and adjust if needed — sometimes removing a stop word or shortening further improves it.
Copy and use
Click the copy button and paste the slug into your WordPress post URL field, Next.js file name, Shopify URL handle, or routing configuration.
Slug conventions by platform
| Platform | Where to set the slug | Auto-generates? |
|---|---|---|
| WordPress | Post editor → Permalink | Yes — from title. Usually needs trimming. |
| Next.js | File name in pages/ or app/ directory | No — you set the file name. |
| Shopify | Product/page → URL and handle | Yes — from title. Review before publishing. |
| Ghost | Post settings → Post URL | Yes — from title. Edit before publishing. |
| Webflow | Collection item → Slug field | Yes — from name field. Edit freely. |
Common slug mistakes and how to fix them
Using the auto-generated slug without reviewing it
Fix: Most CMS platforms auto-generate slugs from the title, but they often include stop words and unnecessary length. Always review and shorten before publishing.
Changing a slug after the page is indexed
Fix: If you must change a live URL slug, set up a 301 redirect from the old URL to the new one. Without a redirect, you lose all backlinks and ranking signals.
Using underscores instead of hyphens
Fix: Replace underscores with hyphens. Google treats hyphens as word separators but underscores as part of a single word — using underscores can hurt your ranking for individual keywords.
Including dates in slugs
Fix: Dates like /2026/03/24/post-title make URLs longer and become misleading when content is updated. Use dateless slugs unless your content type specifically requires dates (e.g., news archives).
Frequently asked questions
What is a URL slug?
A URL slug is the part of a URL that identifies a specific page in a human-readable form. In https://example.com/blog/how-to-bake-bread, the slug is "how-to-bake-bread". Slugs are typically lowercase, use hyphens, and contain no special characters.
Why are hyphens better than underscores in slugs?
Google treats hyphens as word separators in URLs but treats underscores as part of a word. So "how-to-bake-bread" is indexed as four separate words, while "how_to_bake_bread" may be treated as one long word. Hyphens are the universal standard.
How long should a URL slug be?
Keep slugs short and descriptive — ideally 3 to 5 meaningful words. Remove stop words (a, the, in, of, to) unless essential to meaning. For example, "how-to-bake-sourdough-bread" is better than "how-to-bake-a-loaf-of-sourdough-bread-at-home".
Should I include stop words in a slug?
In most cases, no. Stop words like "a", "the", "in", "of", and "to" add length without adding keyword value. Remove them when the slug still reads clearly without them.
Does changing a slug affect SEO?
Yes. If you change a published URL slug without a 301 redirect from the old URL to the new one, you lose all backlinks and search ranking the page has built. Always implement a 301 redirect when changing a live slug.
What is the difference between a slug and a URL?
A URL is the complete web address including protocol and domain: https://example.com/blog/how-to-bake-bread. A slug is just the human-readable path segment: how-to-bake-bread. The slug is one component of the full URL.
Generate a URL slug now
Free, instant, browser-based. Convert any title into a clean, SEO-friendly slug in one click — no sign-up.
Open URL Slug Generator →