How to Fix Underscores in URLs: Switch to Hyphens Safely
Your audit found crawled page URLs that use underscores (_) as word separators, such as /blog/seo_tips. By the end of this guide you will have renamed those slugs to use hyphens, redirected every old URL with a 301, updated internal links and sitemaps, and confirmed that no crawled page URL still contains an underscore.

Why it matters
Google treats hyphens as word separators but has historically treated underscores as word joiners, so /red_shoes can be read as "red_shoes" rather than "red" and "shoes". The ranking effect is small, which is why this is a low-impact check. Hyphenated URLs are still easier for people to read, type and share, and they show more clearly in search results, AI answer citations and link previews.
Renaming URLs carries more risk than leaving them alone, so the redirects in this guide are not optional.
What you need
Step-by-step fix
List every URL that contains an underscore
Crawl the site, or pull the URLs from your XML sitemap, and filter for URLs that contain "_". utm_source=). Path underscores are the main issue to fix.
Query-string underscores usually come from tracking or filter parameters in internal links.
curl -s https://example.com/sitemap.xml | grep -o '<loc>[^<]*_[^<]*</loc>' | sed -e 's/<[^>]*>//g'
Prioritise which URLs to rename
In Search Console, go to Performance > Search results > Pages and check clicks and backlinks for each affected URL. Rename low-traffic and recently published pages first. For pages with strong rankings and many external links, the hyphen gain is small, so plan those for a quiet period and redirect them carefully.
Keep underscores that external systems depend on, such as API endpoints or file downloads referenced by partners, and accept the warning for those.
Build an old-to-new URL mapping
Create a spreadsheet with two columns: the old path and the new path. Replace every underscore with a hyphen, make the slug lowercase, and do not change anything else, so the old and new URLs match one-to-one. This file becomes the source for your redirects and your link updates.
old,new /blog/how_to_choose_running_shoes,/blog/how-to-choose-running-shoes /products/trail_runner_2,/products/trail-runner-2 /about_us,/about-us
Rename the slugs in your CMS or file system
Change each URL slug or handle to the hyphenated version from your mapping. In a CMS this is the page's slug, handle or URL field. html.
Change slugs one batch at a time so that each batch can be redirected straight away.
Add a 301 redirect for every old URL
Redirect each old underscore URL directly to its new hyphen URL with a permanent (301 or 308) redirect. Avoid chains. Point straight to the final URL, and also update any older redirects that pointed to the underscore version.
Use explicit one-to-one rules from your mapping. Regex rules that swap one underscore per pass create a chain of redirects for slugs with several underscores.
# Apache (.htaccess)
Redirect 301 /blog/how_to_choose_running_shoes /blog/how-to-choose-running-shoes
Redirect 301 /about_us /about-us
# Nginx (inside the server block)
location = /blog/how_to_choose_running_shoes { return 301 /blog/how-to-choose-running-shoes; }
location = /about_us { return 301 /about-us; }Update internal links, canonicals and sitemaps
Redirects keep old links working, but internal links should point straight to the new URLs. Update:
- Navigation menus, footers and in-content links (use search-and-replace across your database or content)
- rel="canonical" and hreflang tags, if they are hard-coded
- XML sitemaps, so they list only the hyphenated URLs
- Internal links that add parameters such as utm_source, which should be removed
<link rel="canonical" href="https://example.com/blog/how-to-choose-running-shoes">
Check the redirects and re-run the audit
Request each old URL and confirm that it returns a single 301 to the hyphenated URL, and that the new URL returns 200. Then re-crawl the site, or re-run the audit, and confirm that no crawled page URL contains an underscore. Finally, submit the updated sitemap in Search Console under Indexing > Sitemaps.
curl -sI https://example.com/about_us | grep -iE '^(HTTP|location)' curl -sI https://example.com/about-us | grep -i '^HTTP'
Platform-specific notes
WordPress
WordPress turns spaces in new titles into hyphens. Underscores only appear if someone typed them into the slug. Edit the slug in the block editor under **Post > Settings > URL** (Permalink in some versions). The free Redirection plugin (Tools > Redirection) or Rank Math can create the 301s. Yoast creates them automatically only in Premium. Use the Better Search Replace plugin to update links in post content.
Shopify
Edit the handle in each product, collection or page under **Search engine listing > Edit > URL handle**. Leave **Create a URL redirect** ticked to add the 301 automatically. Shopify's fixed prefixes, such as /products/ and /collections/, cannot be changed. Review your redirects under Content > Menus > URL Redirects (older admins show this as Online Store > Navigation).
Wix
Change the slug in **Page settings > SEO basics > URL slug**, or in the post's SEO settings for blog posts. Wix offers to create a 301 when you change it. Bulk redirects are managed in **Marketing & SEO > SEO > Go to SEO Tools > URL Redirect Manager**.
Next.js
Rename the route folder or file, for example app/about_us to app/about-us. Then add the old paths to the redirects() function in next.config.js using { source: '/about_us', destination: '/about-us', permanent: true }. With permanent: true, Next.js returns a 308, which Google treats the same as a 301.
Cloudflare
If you cannot edit the server, add the mapping in **Rules > Redirect Rules**. For large lists, use **Bulk Redirects** with a CSV upload. Set the status to 301 and turn off query-string forwarding only if you do not need it.
Check that it worked
✅ How to verify
- Run curl -sI on each old URL and confirm it returns one 301 or 308 whose Location header is the hyphenated URL, and that the new URL returns 200.
- Re-crawl with Screaming Frog or a similar tool, filter Internal HTML for URLs containing "_", and confirm the list is empty or contains only the exceptions you chose to keep.
- Re-run the site audit and confirm that the Underscores in URLs check passes or reports only the URLs you deliberately kept.
- In Search Console, use URL Inspection on a few new URLs and request indexing. Over the following weeks, watch Indexing > Pages to see the old URLs move to "Page with redirect".
⚠️ Common mistakes
- Renaming slugs without adding 301 redirects, which turns every old link and indexed URL into a 404 and loses its ranking signals.
- Using a regex that replaces one underscore per redirect, which creates chains of three or four hops for long slugs.
- Leaving internal links, canonical tags and the XML sitemap pointing at the old underscore URLs, which sends mixed signals and adds an extra redirect on every click.
- Renaming high-traffic, heavily linked URLs in bulk for a minor gain, when only new and low-traffic pages needed changing.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
Are underscores in URLs bad for SEO?
They are a minor issue. Google treats hyphens as word separators, while underscores can join words together, so /red_shoes may not match a search for "red shoes" as cleanly. The effect is small. Use hyphens on all new pages, and change existing URLs only when you can redirect them properly.
Should I change existing URLs from underscores to hyphens?
Change them if the pages get little traffic, were published recently, or are being restructured anyway, and always add 301 redirects. For well-ranking pages with many backlinks, the gain is small and you may see a short ranking dip while Google processes the redirects. Many sites leave those as they are and use hyphens going forward.
Do underscores in domain names or query parameters matter?
Underscores are not allowed in registrable domain names. Underscores in query parameters, such as utm_source, do not affect how Google reads your page topic. They only matter for this check when crawlable internal links include them, so remove tracking parameters from internal links.
How long does it take Google to update to the new hyphenated URLs?
Usually a few days to a few weeks, depending on how often Google crawls your site. Submitting the updated sitemap and requesting indexing for key pages in Search Console speeds this up. Keep the redirects in place for at least a year, and ideally permanently.
How to Fix Infinite Scroll Crawlability with Paginated URLs
How to Fix Uppercase Characters in URLs (and Redirect Them)
How to Check Googlebot Activity in Your Server Logs
How to Fix Broken AMP Pages and rel="amphtml" Link Errors
How to Fix Low Text Contrast and Unlabeled Form Fields (WCAG)
How to Enable HTTP/2 or HTTP/3 on Your Website or CDN