Hyphens vs underscores, stop words, max length, special characters — the complete guide to SEO-friendly URL slugs.
The URL slug appears in search results, gets clicked by users, and is shared across the web. Google uses it as a relevance signal — a slug containing your primary keyword outperforms an equivalent page with a meaningless slug like /p=12345. Good slugs also get more clicks in search results because users can see what the page is about before clicking.
word-counter = two searchable words. word_counter = one unsearchable word.| Bad Slug | Good Slug | Why Better |
|---|---|---|
| /p?id=12345 | /age-calculator | Readable, keyword-rich |
| /what-is-a-cron-expression-for-beginners-complete-guide-2024 | /what-is-cron-expression | Shorter, no stop words, no date |
| /compress_image_to_200kb | /compress-image-200kb | Hyphens, no underscores |
| /Home-Loan-EMI-Calculator | /emi-calculator | Lowercase, concise |
Changing a slug breaks existing links and requires a 301 redirect. Only change slugs when: (1) the current slug contains embarrassing errors, (2) the page has no backlinks yet, or (3) the SEO gain is so significant it outweighs the redirect cost. Always implement proper 301 redirects — never let old URLs return 404.