Underscores in URLs: how much they matter and when to change them

Underscores in a URL, like /cold_brew_guide/, are flagged because Google recommends hyphens to separate words in URLs: /cold-brew-guide/. Hyphens are read as word separators; underscores may be read as joining words together. For new pages, use hyphens.

This is one of the lowest-impact checks in the audit. Words in a URL are a very light signal, and Google understands underscore URLs fine in practice. Changing an existing URL means redirects and a period of recrawling, so only change established URLs if you are restructuring anyway, and always with a 301.

What it looks like in the HTML

Before

html
https://example.com/case_study/acme_rollout/

After

html
https://example.com/case-studies/acme-rollout/

Why it matters

Google's URL guidelines ask for simple, readable URLs, with hyphens between words. The practical reason is readability for people: a URL shared in an email or shown in results is easier to read with hyphens, and underscores disappear when a link is underlined.

The search effect is small. A slug is a minor relevance hint compared with the title, headings and content. So the honest advice is to get new URLs right and leave old ones alone unless there is another reason to change them.

Where WordPress underscores come from

WordPress turns spaces in post titles into hyphens automatically, so underscores usually come from somewhere specific:

  • Custom post type and taxonomy keys. When a developer registers a post type like case_study without setting a rewrite slug, WordPress uses the key itself in the URL: /case_study/acme-rollout/. This is the most common source, and it affects every post of that type.
  • Slugs typed by hand. WordPress keeps underscores that you type into the slug field.
  • Imported content. Sites migrated from other systems often keep their old URL formats.
  • File names. Media URLs keep the uploaded file name, underscores included. (This audit checks the page URL, not image URLs.)

How to fix it in WordPress

  1. For new content, use hyphens. Edit the slug in the post's URL settings before publishing.
  2. For a single existing post, decide first whether the change is worth it. If yes, edit the slug. With Auto Redirection turned on in Hydrogen SEO → Redirections, Hydrogen SEO adds a 301 from the old address to the new one automatically when a post, page or term slug changes. Otherwise add the 301 yourself on the same screen.
  3. For a custom post type base, the fix is in code: set a hyphenated rewrite slug where the post type is registered, for example 'rewrite' => array( 'slug' => 'case-studies' ), then visit Settings → Permalinks and click Save to flush rewrite rules. This changes every URL of that type, so add 301 redirects from the old URLs, for example with a server-level pattern rule, before you switch.
  4. Update internal links to point at the new URLs directly, rather than relying on redirects.
  5. Resubmit your sitemap in Search Console so Google finds the new URLs sooner.

When you can ignore this warning

Leave established URLs alone when they rank well, have backlinks, and you have no other reason to restructure. The small gain from hyphens is not worth the risk of broken links or a temporary dip while Google processes the redirects. Fix it for new content and during planned migrations. See the redirects guide if you do move URLs.

How to check the fix

Open the old URL and confirm it returns a 301 to the new one: curl -I https://example.com/case_study/acme_rollout/ should show 301 and a Location header. Check that internal links and the XML sitemap use the new URLs. Rerun the free SEO audit on the new URL.

Common questions

Does Google treat underscores as word separators?

Google recommends hyphens because they are clearly word separators. In practice Google understands underscore URLs well, and the ranking difference is minimal.

Should I change old URLs from underscores to hyphens?

Usually not, unless you are restructuring anyway. Every changed URL needs a 301 redirect and a recrawl, and the benefit is small.

Why does my custom post type URL have an underscore?

WordPress uses the post type key as the URL base unless a rewrite slug is set. A key like case_study produces /case_study/ in URLs.