Skip to content
Pakistan Era logo
Guides

Hyphens or Underscores in URLs: Google's Rule for Pakistani Websites, and When to Change Old URLs

Google recommends hyphens, not underscores, in URLs. Its six URL rules, how Urdu URLs should be encoded, and when a Pakistani site should change old URLs at all

Umer Kureshi, author at Pakistan EraUmer Kureshi5 min read
A plain brass compass on a dark wooden table against a cream wall

Google recommends hyphens, not underscores, to separate words in URLs. Its guide says "we recommend using hyphens (-) instead of underscores (_)" because "hyphens clearly signal a word boundary". So /school-fee-list/ is better than /school_fee_list/. Google updated this guidance on 23 October 2026. If your Pakistani website already ranks with underscore URLs, do not rename them in a hurry. Use hyphens for new pages, and change old ones only with a 301 redirect.

We read Google's URL structure guide and its documentation update log on 4 November 2026. The log entry for 23 October 2026 says Google clarified when to use hyphens versus underscores. Below is every rule in the guide, what it means for a Pakistani site with Urdu or English URLs, and a checklist for deciding whether to touch old URLs at all.

Google's guide gives six URL rules

Google's URL structure guide asks for hyphens between words, readable words instead of long ID numbers, one consistent letter case, short parameters joined with = and &, percent encoding for non-English characters, and no fragments that change the page content. Each rule has examples in the guide.

RuleRecommendedNot recommended
Separate words with hyphens/summer-clothing//summer_clothing/
Separate words at all/green-dress//greendress/
Readable words, not IDs/wiki/Aviation/index.php?topic=42&area=3a5e...
Standard parameters?category=dresses&sort=low-to-high?[category:dresses][sort:...]
No content-changing fragments/potatoes//#/potatoes
Google's URL rules with recommended and not recommended examples

Hyphens mark a word break, underscores do not

Google says that "for historical reasons" it does not recommend underscores, and that hyphens clearly signal a word boundary. In plain terms, Google reads a hyphen as a space between two words. An underscore may join them into one long word instead.

Google's guide uses this pair: /summer-clothing/filter?color-profile=dark-grey is recommended, and /summer_clothing/filter?color_profile=dark_grey is not. The same rule applies to the parameter names after the question mark, not only to the folder names. Google also says to separate words at all where possible, so /greendress is worse than either.

For a Pakistani shop, school or news site, this mostly affects CMS settings. WordPress uses hyphens by default. Some older custom PHP sites, Blogger templates and file names uploaded straight from a phone use underscores. Check your settings once, and every new page after that will be right.

Do not rename old URLs that already rank

Changing a URL that already ranks means Google has to recrawl and process the move, and rankings can wobble while it does, even with a redirect in place. If an underscore URL gets clicks today, the gain from a hyphen is small compared with the risk. Fix underscores on new pages first, and change old ones only during a planned move.

If you do change a URL, every old address needs a permanent 301 redirect to the new one, internal links need updating, and the sitemap must list only the new URLs. Our guide on moving a website without losing Google rankings covers the redirect map. Pages with few or no clicks are the safest to change, because there is little to lose.

  1. Export your URLs from Search Console, Performance, Pages, for the last 12 months.
  2. Mark which underscore URLs get clicks and which get none.
  3. Leave underscore URLs with steady clicks alone.
  4. For pages you change, add a 301 redirect from each old URL to its new hyphen URL.
  5. Update internal links and the sitemap, then check the new URLs with the URL Inspection tool.
Steps to decide whether to change underscore URLs on your website

Urdu URLs must be percent encoded

Google says characters outside the basic English set should be percent encoded in URLs. Its example in Arabic script shows the encoded form as recommended and the raw script as not recommended. The same applies to Urdu slugs on a Pakistani site.

Percent encoding turns each character into codes like %D9%86. Browsers still show the Urdu text to the reader, so this is about what your server and sitemap output, not what people see. If your CMS writes raw Urdu into the sitemap or into links, test a few pages with the URL Inspection tool in Search Console, and resubmit your sitemap after any fix. Many Pakistani sites keep URLs in Roman English even for Urdu pages, which avoids the issue and keeps links short when shared on WhatsApp.

URL typeGoogle's guidance
English wordsUse hyphens, lower case is easiest
Urdu or Arabic scriptPercent encode the characters
Mixed case like /Fee-List/Pick one case, Google treats case as different URLs
Long ID numbersUse readable words where possible

Letter case and fragments cause duplicate pages

Google's URL handling is case sensitive, so /Fee-List/ and /fee-list/ are two different URLs to Google. The guide says to convert all text to the same case. It also says Google Search generally does not support URL fragments, the part after #, for changing page content.

Mixed case usually creeps in through a menu link typed by hand or a link shared with a capital letter. If both versions open the same page, Google may pick one as canonical and ignore the other. The steps to fix "Google chose different canonical" help when that happens. For single-page apps built in React or Vue that load sections with /#/, give each section a real path instead.

Common URL mistakes with letter case, underscores and fragments, and the fix for each

Common questions

Does Google prefer hyphens or underscores in URLs?

Hyphens. Google's URL structure guide says it recommends hyphens instead of underscores to separate words, because hyphens clearly signal a word boundary.

Should I change my old underscore URLs to hyphens?

Only with care. A URL that already ranks can lose ground during a change. Use hyphens for new pages, and change old ones only with a 301 redirect and updated internal links.

Can I use Urdu words in my website's URLs?

Yes, but Google says characters outside the basic English range should be percent encoded. Many Pakistani sites use Roman English URLs instead to keep links short.

Are URLs case sensitive in Google Search?

Yes. Google says its URL handling is case sensitive, so use one case throughout. Lower case is the simplest choice.

When did Google update its URL structure guidance?

Google's documentation update log lists 23 October 2026 as the date it clarified when to use hyphens versus underscores to separate words in URLs.

Sources and last checked

On 4 November 2026 we read Google Search Central's URL structure best practices and its documentation updates log. The rules, quotes and examples come from the guide, and the 23 October 2026 date comes from the log. The advice on when to change old URLs is our own.

About the author

Umer Kureshi, author at Pakistan Era

Founder and Editor

Umer Kureshi

Umer Kureshi founded Pakistan Era in July 2024 and runs it as administrator, SEO lead and writer, overseeing website operations, search growth, content strategy and coverage of technology and current affairs.

TopicsGoogle SearchSEOWebsitesURLsPakistan