Advertisement

What Is a URL Slug? How to Write SEO-Friendly URLs (With Examples)

September 18, 2026 · 6 min read

The slug is the last part of a web address that identifies a specific page. In yourdevil.shop/blog/what-is-a-url-slug, the slug is 'what-is-a-url-slug'. It looks like a small detail, but a clean slug makes a link easier to trust, remember and share — and it gives search engines a hint about what the page covers.

Good slug vs bad slug

  • Good: /blog/strong-password-guide
  • Bad: /blog/post.php?id=4821&cat=7
  • Bad: /blog/The%20Ultimate%20Guide%20To%20Strong%20Passwords%20In%202026!!!

Seven rules for clean slugs

  • Use lowercase letters only
  • Separate words with hyphens, not underscores or spaces
  • Keep it short: three to six words is usually enough
  • Include the main keyword naturally
  • Remove filler words like 'a', 'the' and 'and' when they add nothing
  • Avoid dates if you plan to update the article later
  • Never use special characters or emojis

Should you change an old slug?

Only if it is truly confusing. Changing a slug breaks every existing link to that page. If you must change it, set up a permanent (301) redirect from the old address to the new one so visitors and search engines are sent to the right place.

Slugs for online shops

For product pages, describe the product rather than repeating the category: /products/black-leather-wallet is better than /products/wallets-wallet-black-123. Keep variant details such as size and colour in filters, not in the slug, so you do not create many near-duplicate pages.

Create one in a second

Paste any title into the Legend Tools Slug Generator. It lowercases the text, removes accents and symbols, and joins words with hyphens, giving you a clean slug you can copy straight into WordPress, Shopify or any CMS.

Advertisement

Keep reading

How Many Words Should a Blog Post Have to Rank in 2026?

Word count is not a ranking factor on its own, but length still matters. Here is how to pick a target length for each type of page and hit it without padding.

What Makes a Password Strong? A Plain-English Guide

Length beats complexity, reuse is the real danger, and password managers are not optional any more. A practical guide to passwords that actually hold up.

How to Clean Up Text Copied From a PDF or Email

Broken line breaks, double spaces and invisible characters make pasted text unusable. Here is a repeatable three-step cleanup that takes under a minute.

JSON Explained for Beginners: Read, Format and Fix It in Minutes

A plain-language guide to JSON: what it is, how its syntax works, the five errors that break it most often, and how to format and validate it safely in your browser.

How to Take a Screenshot on Windows, Mac, Android and iPhone (2026 Guide)

Every shortcut you need to capture your screen on Windows, macOS, Android and iPhone, plus tips for full-page captures, cropping, and sharing clear screenshots.

Title Case, Sentence Case or UPPERCASE? A Practical Guide to Text Case

When to use title case, sentence case, uppercase and lowercase in headings, buttons, emails and social posts — with clear examples and common mistakes to avoid.

How to Remove Duplicate Lines From a List (Emails, Keywords, Names)

Three fast ways to remove duplicates from a list — in a browser tool, in Excel or Google Sheets, and with simple tips to avoid duplicates in the first place.

Advertisement

Advertisement