{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-hyphens-7c515e32af1f","title":"Optimize URLs with Hyphens for SEO","summary":"Improve SEO by using hyphens in URLs to separate words, ensuring Google correctly interprets keyword queries. This includes generating hyphenated slugs, auditing URL structures, and setting up 301 redirects during URL migrations.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-hyphens-7c515e32af1f","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-hyphens-7c515e32af1f","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-hyphens-7c515e32af1f.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-hyphens-7c515e32af1f\/download","category":{"slug":"content-editorial","name":"Content & Editorial"},"editor_note":"Before implementing hyphenated URLs, ensure that all existing URLs with underscores or spaces are redirected using 301 redirects to preserve link equity. Also, update internal links and sitemap.xml to reflect the new hyphenated URLs.","instructions":"---\nname: hyphens\ndescription: \"Use when auditing URL structures for word separator format, generating slugs from titles, or planning a URL migration from underscores or spaces to hyphens with appropriate redirects.\"\nmetadata:\n  category: seo\n  priority: medium\n  difficulty: intermediate\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/seo\/hyphens\n---\n\n# Use hyphens in URLs\n\nGoogle's search systems interpret hyphens in URLs as word boundaries, enabling it to match the URL against individual keyword queries. Underscores join words into a single token, meaning `\/seo_practices` is seen as one word 'seopractices' rather than two separate words 'seo' and 'practices'.\n\n## Quick Reference\n\n- Use hyphens (`-`) to separate words in URLs \u2014 Google treats hyphens as word separators, underscores as part of the word\n- `\/best-seo-practices` is better than `\/best_seo_practices` or `\/bestseopractices`\n- Changing existing URLs from underscores to hyphens requires 301 redirects to preserve link equity\n\n## Check\n\nInspect the URL path segment of each page. Flag any URL that contains: (1) Underscores (`_`) as word separators (e.g., `\/best_practices`). (2) Spaces encoded as `%20` or `+` in path segments. (3) Mixed separators in the same URL (e.g., `\/best-practices_guide`). Report the count of non-hyphenated URLs by category.\n\n## Fix\n\n1. Identify all pages with underscores or spaces in URL path segments.\n2. Generate the hyphenated equivalent: replace `_` with `-`, spaces\/`%20` with `-`.\n3. Set up 301 permanent redirects from the old URLs to the new hyphenated URLs.\n4. Update internal links throughout the site to point to the new URLs.\n5. Submit the new URLs to Google Search Console for re-indexing.\n6. Update your sitemap.xml to include only the new hyphenated URLs.\n7. In your CMS or slug-generation function, enforce hyphens going forward:\n   - Slug: title.toLowerCase().replace(\/\\s+\/g, '-').replace(\/[^a-z0-9-]\/g, '')\n\n\n## Explain\n\nGoogle's John Mueller has confirmed that Google interprets hyphens as word separators in URLs, but treats underscores as word joiners. This means a URL with underscores matches fewer individual keyword queries. For example, `\/web_design` would match 'web_design' as a single token, while `\/web-design` matches both 'web design' and 'webdesign' queries.\n\n## Code Review\n\nParse all URL paths used in the application's router or CMS slug fields. Flag any path segment containing `_` characters between words or any `%20` space encoding. Verify slug-generation utilities produce lowercase hyphenated output. Check redirect rules to confirm old underscore URLs are permanently (301) redirected to their hyphenated equivalents.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/seo\/hyphens\n","use_cases":["Auditing URL structures for SEO compliance","Generating slugs from page titles","Planning URL migrations from underscores to hyphens"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/hyphens\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T16:29:36.000000Z","updated_at":"2026-11-23T04:55:21.000000Z","seo_title":"Optimize URLs with Hyphens for SEO","seo_description":"Use hyphens in URLs to improve SEO, as Google treats them as word separators. Replace underscores and spaces with hyphens for better search visibility and ensure proper 3","seo_keywords":["SEO URL optimization","Hyphenated URLs for SEO","Replace underscores with hyphens","URL slug generation","SEO best practices"]}}