Real fixes from seven live sites. No pitch.Log in / My reports
Idea to Traffic Pressure Test

Underscores in Your URLs: Should You Switch to Hyphens?

Usually not, if the pages are already indexed and getting impressions. Google recommends hyphens for new URLs, but in October 2026 it also said words in a URL are an incredibly small ranking signal, so renaming live pages trades a tiny gain for weeks of redirect churn. Switch only on a brand new site or during a migration you are already doing.

Every few months someone launches a site, notices their URLs look like /best_budget_mics, reads that Google prefers hyphens, and wonders whether to rename every page this weekend. In October 2026 Google gave that question two fresh answers in the same month, and together they make the decision fairly simple.

What Google said in October 2026

On October 14, Google published an episode of its search video series where Gary Illyes covered URLs, domain names and emoji in paths. His point on keywords was blunt: words in a URL or domain are an incredibly small ranking signal and will not do much for you. He also repeated the long standing advice to separate words in the path with hyphens.

A week later, on October 21, Google revised the "Use hyphens to separate words" section of its URL structure best practices page in Search Central. The recommendation did not change. The wording now explains why: underscores are commonly used to join things that belong together (think format_date in code), while a hyphen clearly marks a boundary between two words. Search Engine Roundtable described it as a minor change whose overall meaning stayed the same.

So the official position is: hyphens are the better choice for new URLs, and the words in your URL barely move rankings either way. Neither statement says that existing underscore URLs are broken or penalized.

Why changing live URLs usually costs more than it earns

Renaming a URL is not a cosmetic edit. Every changed address becomes a new page in Google's eyes that has to be discovered, crawled and connected back to the old one through a redirect. During that handover you can expect some of the following:

  • Rankings and impressions for the moved pages wobble for days or weeks while Google processes the redirects.
  • Old URLs keep showing in Search Console reports for a while, which looks alarming even when everything is fine.
  • Any link you forget to update (internal links, your sitemap, canonical tags, social profiles, a newsletter) now goes through an extra hop or, worse, to a 404 if a redirect is missing.
  • Backlinks other people gave you still point at the old address forever, so the redirects can never be removed safely.

Weigh that against the upside Google itself called incredibly small. For an indexed page that already earns impressions, the trade is almost always bad.

A decision rule you can apply today

Open Search Console, go to Indexing > Pages and then Performance > Search results, and sort your underscore URLs into one of these groups:

  1. Leave them alone if the pages are indexed and receive impressions or clicks. Use hyphens for every new page from now on. Mixed styles on one site are fine.
  2. Change them now if the site is only a few weeks old, has a handful of indexed pages, and has no backlinks yet. The cost of redirects is close to zero at this stage, and you only want to do it once.
  3. Change them as part of a bigger job if you are already moving domains, merging sections or rebuilding the site. Fold the cleanup into the redirect map you are making anyway rather than doing a second migration later.
  4. Fix the real problems first if your URLs contain session IDs, long tracking parameters, mixed upper and lower case versions of the same page, or #/ fragments that swap content. Google's URL page treats these as crawl problems, and they matter far more than the separator you picked.

If you are unsure which group your site falls into, running it through the free site checker will show whether redirects, canonicals and your sitemap already agree with each other before you add more URLs to the mix.

How to switch safely on Cloudflare Pages

If you land in group 2 or 3, here is a sequence that works on a static site hosted on Cloudflare Pages. The same logic applies on any host, only the redirect file format differs.

Step 1. Rename the files. From your project folder, list every HTML file with an underscore and rename it with git so history is kept:

find . -name "*_*.html" -not -path "./node_modules/*"
git mv best_budget_mics.html best-budget-mics.html

Step 2. Write one 301 per URL in _redirects. Cloudflare Pages reads a plain text file named _redirects in your output folder. Each line is source, destination, status code. Always write 301, because the default when you leave it off is a temporary 302:

/best_budget_mics /best-budget-mics 301
/best_budget_mics.html /best-budget-mics 301
/guides/usb_vs_xlr /guides/usb-vs-xlr 301

You cannot convert underscores to hyphens with a single wildcard rule, because wildcards and named segments copy text as is. You need one line per page. This shell loop prints them for you from the list of files you renamed, run before the rename:

find . -name "*_*.html" | sed 's|^\.||; s|\.html$||' | while read p; do
  echo "$p ${p//_/-} 301"
done >> _redirects

Cloudflare allows up to 2,000 static and 100 dynamic redirects in that file, with 1,000 characters per line. Past that you move to Bulk Redirects in the Cloudflare dashboard. One trap: rules in _redirects are not applied to requests handled by Pages Functions, so if a path is served by a Function, the redirect has to live in the Function code.

Step 3. Update everything that points at the old addresses. Internal links in your templates and posts, the URLs in sitemap.xml, each page's <link rel="canonical">, and any structured data. A redirect is a safety net, not a substitute for linking to the right URL.

Step 4. Verify every redirect from the command line. After the deploy finishes, check that each old URL answers with a single 301 to the new one, and that the new one answers 200:

curl -sI https://example.com/best_budget_mics | grep -iE "^(HTTP|location)"
curl -sI https://example.com/best-budget-mics | head -1

You want to see HTTP/2 301 with a location pointing to the hyphen version, and then HTTP/2 200. A 302, a chain of two hops, or a 404 means something in the file is wrong.

Step 5. Tell Google and then wait. Resubmit the sitemap under Indexing > Sitemaps, and use URL Inspection on your two or three most important new URLs to request indexing. Then leave it. Google's site move guidance says to keep redirects in place as long as possible, generally at least a year. For URLs with backlinks, keep them permanently.

Other URL rules worth more than the separator

While you are reading your URL list, the same Google page has a few points that cause real indexing trouble on new sites:

  • Case matters. Google treats /Apple and /apple as two different URLs. If your server returns the same page for both, pick lowercase and redirect the rest.
  • Fewer parameters. Filters, sort orders and tracking tags can multiply one page into hundreds of URLs. Keep them out of internal links where you can.
  • No content behind fragments. Google generally ignores everything after #, so a page that changes content based on #/section looks like one page.
  • Non-ASCII characters get percent encoded. Emoji and accented letters in paths are allowed, but they travel as encoded bytes, which is ugly when people share the link.

Get those right, use hyphens going forward, and let your older underscore URLs keep doing their job.

Where this question came from

Questions about underscores, hyphens and URL changes

Does Google penalize underscores in URLs?

No. Google recommends hyphens because they clearly mark word boundaries, but underscore URLs are crawled, indexed and ranked normally. The difference is a readability and convention issue, not a penalty.

Are keywords in the URL a ranking factor?

Barely. In an October 2026 Google video, Gary Illyes called keywords in a URL or domain an incredibly small signal that will not do much. Write short, readable URLs for people and move on.

How long should I keep 301 redirects after changing URLs?

Google's site move guidance says to keep redirects as long as possible, generally at least one year. If other sites link to the old URLs, keep those redirects permanently.

Can one Cloudflare Pages redirect rule turn all underscores into hyphens?

No. Wildcards and named segments in the _redirects file copy text exactly, they cannot replace characters. Generate one 301 line per URL instead, up to 2,000 static rules, or use Bulk Redirects beyond that.