Hello ANNA!!
Technical SEO

Hreflang Guide: Setting Up Language and Country Targeting

Say a Jaipur-based handicrafts exporter has three versions of its site: English for India with prices in rupees, English for the US with prices in dollars, and Hindi. Without hreflang, Google may show the Indian rupee page to someone searching from New York, or treat the two English versions as duplicates and pick one. Hreflang annotations tell Google these pages are alternates of each other and who each one is for.

It doesn't boost rankings. It helps Google swap in the right version of a page that already ranks.

Do you need hreflang?

You need it if you have the same or equivalent content in more than one language, or in one language tailored to different countries (different currency, shipping, legal info or spelling).

You don't need it if:

  • Your site is in one language for one market.
  • You have a translated page or two but no real regional strategy. A language switcher may be enough.
  • Your "versions" are entirely different businesses or content.

Google's documentation says hreflang is a signal rather than a directive, and Google can often work out language without it. Where it really helps is same-language, different-country setups like English for India, the UK and Australia.

The codes

Each annotation uses a language code, optionally followed by a region code:

  • Language: ISO 639-1, such as en, hi, ta, fr.
  • Region: ISO 3166-1 alpha-2, such as IN, US, GB, AE.

So en-IN is English for India, hi-IN is Hindi for India, and en alone is English for anyone. You cannot use a region on its own: IN is invalid. And en-UK is wrong; the code for the United Kingdom is GB.

There's also x-default, which marks the fallback page for users who don't match any listed version. This is often a language selector page or your main international version.

Three ways to implement

<link rel="alternate" hreflang="en-IN" href="https://example.com/in/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/us/" />
<link rel="alternate" hreflang="hi-IN" href="https://example.com/hi/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />

Simple for small sites. On large sites with many languages, the head gets long.

HTTP headers

For non-HTML files like PDFs, send the same information in a Link: header.

XML sitemap

List each URL with xhtml:link alternates. This keeps the markup out of your pages and is easier to manage at scale, though harder to spot-check by viewing source. The XML sitemaps guide covers sitemap basics.

Pick one method. Mixing them is allowed but makes errors harder to find.

Rules Google expects

Return tags. If page A lists page B as an alternate, page B must list page A. Without the return link, Google may ignore the pair. This is the most common hreflang error by far.

Self-reference. Each page should include itself in its own set of hreflang tags.

Point to canonical, indexable URLs. The URLs in your hreflang set should be the canonical versions, return 200 and not be noindexed or redirected. If your Hindi page canonicalises to the English page, you're telling Google two contradictory things. See canonical tags for how these interact: each language version should usually have a self-referencing canonical.

Absolute URLs. Include protocol and domain.

Page-level, not site-level. Hreflang maps individual equivalent pages. Your /in/kurtas/ page should point to /us/kurtas/, not to the US homepage.

URL structure for international sites

Hreflang works with any structure, but you need one:

StructureExampleNotes
Subfoldersexample.com/in/, example.com/us/Easiest to manage; shares domain authority
Subdomainsin.example.comWorkable; a bit more separation
Country domainsexample.in, example.comStrong local signal; costs more to build authority for each
Parametersexample.com?lang=hiNot recommended

For most small and mid-size businesses, subfolders are the practical choice.

Common mistakes

  • Missing return tags, especially after adding a new language to some pages but not updating the others.
  • Wrong codes: en-UK, in-HI, or using jp instead of ja for Japanese.
  • Hreflang pointing at redirected or non-canonical URLs.
  • Automatically redirecting users by IP. Googlebot mostly crawls from US addresses, so forced geo-redirects can stop it from ever seeing your other versions. Suggest the local version with a banner instead.
  • Machine-translated pages left unedited. Hreflang doesn't fix poor content; a badly translated page still won't satisfy searchers.
  • Forgetting to update hreflang when URLs change during a migration.

Checking your setup

Search Console no longer has a dedicated International Targeting report, so use a crawler that validates hreflang (most major SEO crawlers do) to check for missing return tags, invalid codes and non-200 targets. Then spot-check a few pages by searching from different countries, using a VPN or Google's region settings, and see which version appears.

If you're planning a multilingual build, site architecture is worth reading first, since the folder structure you choose will shape everything else.

List every language and country version you actually serve, write the codes down once, correctly, and use that list as the single source for every template and sitemap. Most hreflang problems start with someone typing the codes from memory.

FAQ

Hreflang Guide: Setting Up Language and Country Targeting: common questions

Does hreflang improve rankings?

Not directly. It helps Google show the most appropriate language or regional version of a page in each market. The page still needs to rank on its own merits.

Do I need hreflang for a single-language site?

No. If you serve one language to one market, hreflang adds nothing. It becomes useful when equivalent content exists for different languages or countries.

What does x-default mean?

x-default marks the fallback page for users whose language or location doesn't match any version you listed. It is often a language selector or your main international page.

Why is Google ignoring my hreflang tags?

The usual causes are missing return tags, invalid language or region codes, or hreflang pointing at URLs that redirect, are noindexed or canonicalise elsewhere. A crawler with hreflang validation will list these.

Can I use hreflang across different domains?

Yes. Hreflang works across domains, subdomains and subfolders, as long as each page links to all its alternates and those pages link back.

Related guides