Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Underscores or spaces in URLs: how to find and fix them

SEO-124Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

A URL is the web address of a page. Some URLs separate words with an underscore, like /blue_widgets/, or contain a space, which browsers show as %20, like /blue%20widgets. Spaces are not allowed in URLs, so they must be encoded.

Google's documentation recommends hyphens to separate words in URLs. It says it treats hyphens as word separators and advises against underscores. A URL like /blue-widgets/ is read as two words. /blue_widgets/ may be read as one joined token.

How the same page looks with different separators
URLStatusWhy
/blue-widgets/GoodHyphens clearly separate words
/blue_widgets/AvoidUnderscores may join words together
/blue%20widgetsAvoidEncoded space, ugly and easy to break
/Blue-Widgets/RiskyUppercase can create duplicate versions

Why it costs you leads or sales

The direct ranking effect is small. The bigger costs are practical. Links with spaces get cut off in emails, chat apps and ads, so the visitor lands on an error page. Long %20 strings look untrustworthy in search results and social previews.

Messy URLs also tend to come with other problems: duplicate versions, inconsistent tracking links and broken redirects. A broken landing page link means paid clicks and referrals are wasted.

How a space in a URL loses a visitor
  1. You share link/our services/pricing
  2. App cuts linkLink ends at the space
  3. 404 pageVisitor sees an error
  4. Lead formNever reached

A link with a space is cut off when it is pasted into a message.

How to check if your site has it

Find affected URLs
  1. Crawl your site

    Run a crawler such as Screaming Frog (URL tab, filter for Underscores and Contains Space) or Sitebulb. Both list URLs with these patterns.

  2. Check your XML sitemap

    Open /sitemap.xml and search the page for _ and %20.

  3. Check Google Search Console

    Go to Indexing > Pages and use the search filter on the URL list, or the Performance report with a URL filter containing _ or %20.

  4. Check links on key pages

    View the source of your menu, footer and landing pages and look for hrefs with underscores or spaces.

How to fix it

Decide first whether a change is worth it. If a URL already ranks and gets traffic, a change carries some risk. New pages should always use hyphens. For existing pages, change them when you can add a clean 301 redirect and update internal links.

Change the URL slug and redirect the old one
  1. Edit the slug

    Open the page or post, find Permalink in the sidebar and replace underscores with hyphens. Update.

  2. Add a 301 redirect

    WordPress usually redirects old post and page slugs automatically. Check it, or add a rule in a redirect plugin you already use.

Apache: redirect one old URLhtaccess
Redirect 301 /blue_widgets/ https://www.example.com/blue-widgets/
Nginx: redirect one old URLnginx
location = /blue_widgets/ {
  return 301 https://www.example.com/blue-widgets/;
}
After changing a slug
  1. Update internal links

    Edit menus, footer, buttons and in-content links to point straight to the new URL, so they don't pass through a redirect.

  2. Update the sitemap and canonical tags

    Make sure both show the new hyphenated URL only.

  3. Update ads and email links

    Change any ad final URLs, email templates and social bios that use the old address. Keep your UTM parameters intact.

URL clean-up

Before

  • /Our_Services/Web_Design
  • /price list.html
  • Links break when pasted into chat
  • Case variants can create duplicates

After

  • /our-services/web-design/
  • /price-list/
  • Links paste cleanly everywhere
  • Old URLs 301 to the new ones

How to confirm it's fixed

Confirmation checks
  • Old URL returns a 301 to the new hyphenated URL (check with a redirect checker or curl -I).
  • New URL returns 200 and loads the right page.
  • The new URL is the canonical and appears in the sitemap.
  • Internal links point to the new URL, not through the redirect.
  • A re-crawl shows no remaining underscore or space URLs.
  • In Search Console, inspect the new URL and request indexing.
Check the redirect from a terminalbash
curl -I https://www.example.com/blue_widgets/
# Expect: HTTP/2 301 and location: https://www.example.com/blue-widgets/

How to prevent it happening again

Prevention habits
  • Write a URL rule: lowercase, hyphens, no spaces, no special characters.
  • Check the slug before publishing any new page, product or landing page.
  • Brief agencies, freelancers and importers on the rule, especially for bulk CSV uploads.
  • Run a scheduled crawl each month and filter for underscores and spaces.
  • Keep a redirect list so old URLs are never left dead.

How FunnelGuard handles this

FunnelGuard does not check for underscores or spaces in URLs today. It is a possible future check. FunnelGuard is a synthetic monitoring service: a robot visitor runs your real customer journeys, such as lead forms and checkouts, on a schedule and checks each step.

What it does catch nearby is a journey that breaks because a link no longer works. If a renamed URL leads to an error page partway through a monitored journey, the failed step is re-checked from a second region and you get one alert with a screenshot and a likely cause. That only covers the pages your journeys visit, not your whole site.

To watch for this issue itself, schedule a monthly crawl with Screaming Frog or Sitebulb, and check your sitemap and Search Console URL lists. A free read-only website audit is also available from FunnelGuard, and the Free plan covers 1 site and 2 journeys with daily checks, no card needed.

Questions people ask

Are underscores in URLs bad for SEO?

The direct ranking effect is small, but Google recommends hyphens to separate words and advises against underscores. Hyphens are read as word breaks, while underscores may join words into one token. For new pages, use hyphens.

Should I use hyphens or underscores in URLs?

Use hyphens. Google's guidance treats them as word separators, and they are the common standard for readable URLs. Keep everything lowercase for consistency.

Why does my URL show %20?

%20 is the encoded form of a space. URLs cannot contain a literal space, so the browser converts it. It usually means the page name, file name or slug contained a space and should be changed to a hyphen.

How do I change underscores to hyphens in my URLs?

Edit the page slug in your CMS (permalink, handle or URL slug field) and replace underscores with hyphens. Then add a 301 redirect from the old URL to the new one, and update internal links, the sitemap and any ads.

Will changing my URLs hurt my rankings?

A properly redirected change usually has limited impact, but there is always some risk. Use a 301 redirect for every changed URL, update internal links and change pages in small batches. If a page ranks well and the gain is small, you may choose to leave it.

Do underscores in UTM parameters or image file names matter?

No. Underscores in query parameters like utm_source and in file names for images or scripts are normal. This issue concerns the path of page URLs.

How do I find all URLs with spaces or underscores on my site?

Crawl the site with a tool such as Screaming Frog or Sitebulb and filter the URL list for underscores and spaces. You can also search your XML sitemap and Search Console page lists for _ and %20.

Does FunnelGuard check for underscores or spaces in URLs?

Not yet. It is a possible future check. FunnelGuard does monitor your customer journeys, so a renamed URL that breaks a monitored journey would show up as a failed step.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.