What is hreflang? Hreflang is an attribute you add to a page's <link rel="alternate"> tags (or HTTP headers, or XML sitemap) to tell search engines which other URLs are versions of the same page for a different language or country. It does not change rankings by itself. It helps Google show the right version, such as your en-AU page to someone searching in Australia, instead of your en-US page.
Key takeaways
- Hreflang links equivalent pages across languages or regions. Each page lists itself and every alternate, and every alternate must link back.
- Codes are an ISO 639-1 language (
en) plus an optional ISO 3166-1 alpha-2 region (GB). The UK isen-GB.en-UKdoes nothing in Google Search. - There are three equivalent methods:
<link>tags in the<head>, HTTPLinkheaders (for PDFs and other non-HTML files), and XML sitemaps. Pick one. - Each version should be self-canonical. Do not canonicalise your en-IN page to your en-US page.
- Google retired the Search Console International Targeting report in 2022. Today you check hreflang with View Source, URL Inspection and a crawler.
What does hreflang mean?

The name is a mash of two HTML terms: href (the link target) and lang (language). So "hreflang" stands for "the language of the linked page".
It started as a standard HTML attribute. Google adopted it for search, and SEOs now use the words "hreflang tags", "hreflang attributes" and "hreflang annotations" for the same thing. Strictly, hreflang is an attribute on a <link> element. I'll say "tags" because that is what most people search for.
A single hreflang tag looks like this:
<link rel="alternate" hreflang="en-AU" href="https://example.com/en-au/" />
Read it as: "An alternate version of this page, for English speakers in Australia, lives at this URL."
How does hreflang work?

Google crawls a page, finds its hreflang annotations, and groups the listed URLs into a cluster. When someone searches, Google uses the cluster to swap in the version that best matches the searcher's language and location.
Three rules make the cluster valid, per Google's localized versions documentation:
- Self-reference. Each version must list itself as well as every other version.
- Return links. If page A points to page B, page B must point back to page A. Google says that if two pages don't point to each other, the tags are ignored.
- Fully qualified URLs. Every
hrefmust be absolute, includinghttps://. Alternates can sit on different domains.
Two points people get wrong:
- Hreflang is a hint, not a command. Google still decides which URL to show. Bad signals elsewhere (mixed canonicals, redirects, noindex) can override it.
- Hreflang does not tell Google what language your content is in. Google states it doesn't use
hreflangor the HTMLlangattribute to detect page language. It reads the visible text. If your "Hindi" page is mostly English, hreflang won't fix that.
When to use hreflang

Use hreflang when you have equivalent pages that differ by language, region, or both:
- Different languages: an English page and a Hindi translation.
- Same language, different regions: separate English pages for India, Australia, the UK and the US, with local prices, spellings, phone numbers or shipping terms.
- A mix: English and French versions for Canada (
en-CA,fr-CA).
The second case is where hreflang matters most. Translated pages are rarely confused with each other. Near-identical English pages for four countries often are. Google's canonicalization guide treats same-language regional variants as duplicates and recommends using both canonicals and hreflang for them. Without hreflang, Google may index one and fold the others away, which often shows up in Search Console as Duplicate without user-selected canonical.
Do I need hreflang for a site targeting India, the UK and the US in English?
Only if you have separate URLs for each country. If one English page serves all three markets, there is nothing to annotate, and you don't need hreflang.
If you do run /en-in/, /en-gb/ and /en-us/ with real differences (rupee pricing, GST notes, UK delivery times), then yes. Those pages are near-duplicates, and hreflang is how you tell Google they are deliberate regional versions.
Why is hreflang important?
- Right page, right market. An Australian searcher sees AUD prices and local contact details, not your US page.
- Fewer duplicate clusters. Regional pages are recognised as alternates instead of competing copies.
- Better clicks and fewer bounces. People land on the version that matches them. That is a user benefit, not a direct ranking boost.
Hreflang won't make a weak page rank. It decides which of your pages shows up where you already have visibility.
Hreflang codes: language and region
The value has one or two parts:
| Part | Standard | Required? | Examples |
|---|---|---|---|
| Language | ISO 639-1 | Yes | en, hi, fr, de |
| Region | ISO 3166-1 alpha-2 | Optional | IN, AU, GB, US |
Rules from Google's documentation:
- Language first, region second:
en-IN, notIN-en. - Region alone is not allowed.
hreflang="IN"is invalid. You needen-INorhi-IN. - The UK is
GB. Google listsUK,EUandUNas values that have no effect. Useen-GB. - Case doesn't matter, but
en-GB(lowercase language, uppercase region) is the convention. es-419(Latin American Spanish) isn't supported by Google, because it is not an ISO 3166-1 code.
Use a language-only code such as en when one page serves all English speakers who don't have a regional version.
What is hreflang x-default?
x-default is a reserved value for the fallback page. Google uses it when no other version matches the user's browser language or location.
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
Typical x-default targets:
- A global English page.
- A country or language selector page.
- A homepage that auto-detects and suggests a version.
x-default is optional, but I add it on every international site. Without it, a searcher in Singapore or Nigeria gets whichever version Google guesses.
How to implement hreflang tags: the three methods
Google treats all three methods as equivalent and says using more than one gives no added benefit. Choose the one your stack can keep accurate.
1. HTML link tags in the <head>
Best for small and medium sites, and for CMSs that output tags per page.
<head>
<link rel="alternate" hreflang="en-IN" href="https://example.com/en-in/pricing/" />
<link rel="alternate" hreflang="en-AU" href="https://example.com/en-au/pricing/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing/" />
</head>
The tags must sit inside a well-formed <head>. A stray <div> or script that breaks the head can push them into the body, where Google won't read them.
2. HTTP headers (for PDFs and non-HTML files)
A PDF has no <head>, so you send hreflang in the server response:
Link: <https://example.com/en-in/brochure.pdf>; rel="alternate"; hreflang="en-IN",
<https://example.com/en-au/brochure.pdf>; rel="alternate"; hreflang="en-AU",
<https://example.com/brochure.pdf>; rel="alternate"; hreflang="x-default"
This is set in the server or CDN config. Each PDF in the set must return the full header.
3. XML sitemap
Best for large sites, or when you can't edit page templates. If you're new to sitemaps, start with my XML sitemap guide.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/en-in/pricing/</loc>
<xhtml:link rel="alternate" hreflang="en-IN" href="https://example.com/en-in/pricing/" />
<xhtml:link rel="alternate" hreflang="en-AU" href="https://example.com/en-au/pricing/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/pricing/" />
</url>
<url>
<loc>https://example.com/en-au/pricing/</loc>
<xhtml:link rel="alternate" hreflang="en-IN" href="https://example.com/en-in/pricing/" />
<xhtml:link rel="alternate" hreflang="en-AU" href="https://example.com/en-au/pricing/" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/pricing/" />
</url>
</urlset>
Note the xmlns:xhtml namespace. Every <url> repeats the full set, including itself. Google says the order of <xhtml:link> entries doesn't matter.
Worked example: one English site, four markets plus x-default
Say a services business runs these URLs:
| Market | URL | hreflang |
|---|---|---|
| India | https://example.com/en-in/ |
en-IN |
| Australia | https://example.com/en-au/ |
en-AU |
| United Kingdom | https://example.com/en-gb/ |
en-GB |
| United States | https://example.com/en-us/ |
en-US |
| Everyone else | https://example.com/ |
x-default |
Every one of the five pages carries the same block in its <head>:
<link rel="alternate" hreflang="en-IN" href="https://example.com/en-in/" />
<link rel="alternate" hreflang="en-AU" href="https://example.com/en-au/" />
<link rel="alternate" hreflang="en-GB" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="en-US" href="https://example.com/en-us/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
And each page has its own self-referencing canonical. On the Australian page:
<link rel="canonical" href="https://example.com/en-au/" />
Why this works:
- Self-reference is built in. The en-AU page lists
en-AUpointing to itself. - Return links are automatic. Because the block is identical on all five pages, every pair points both ways.
- Codes are valid.
en-GB, noten-UK. - The x-default page is part of the cluster and links back to the four regional pages.
Want an extra catch-all for English speakers in, say, New Zealand or Singapore? Add hreflang="en" pointing to your best general English page (often the same URL as x-default) to every page in the set.
Repeat the pattern for every equivalent page (/en-in/pricing/ and its siblings, and so on). Hreflang works page to page, not site to site. Annotating only the homepage leaves the rest of the site unclustered.
Hreflang vs canonical: what's the difference?
They answer different questions:
| Canonical | Hreflang | |
|---|---|---|
| Question it answers | "Which URL is the main one among duplicates?" | "Which URL suits which language or region?" |
| Effect | Consolidates signals onto one URL | Swaps the right alternate into results |
| Points to | One preferred URL | Every version in the set |
The common mistake is canonicalising every regional page to one "master" page, such as all four English versions pointing to /en-us/. That tells Google only the US page should be indexed, which cancels the other hreflang entries. Google's canonical documentation says hreflang annotations are not used for canonicalisation, and when you use hreflang you should specify a canonical in the same language (or the best substitute language).
In practice: each language or regional version is self-canonical, and hreflang links them. Also make sure every URL in your hreflang set is the canonical URL, not a parameter or trailing-slash variant. I cover canonical setup in full in my canonical tags guide.
How to add hreflang tags in WordPress
WordPress core doesn't output hreflang. Your options:
- Multilingual plugins. WPML says it inserts hreflang tags automatically and updates them as content changes. Polylang also outputs hreflang automatically, but by its own documentation it generates x-default only on the homepage, so other pages need a snippet if you want x-default site-wide.
- Dedicated hreflang plugins for sites where regional English pages are built as normal pages rather than translations. You map equivalents manually.
- Sitemap or theme code for custom builds, generating the full set from a mapping table.
Whichever route you take, view the source of a few pages after setup. Plugins can miss URLs that sit outside their translation links, such as custom post types or landing pages built in a page builder.
How to check hreflang tags
Search Console used to have an International Targeting report that flagged hreflang errors. Google deprecated it in 2022 (Search Console Help). Google still supports hreflang, but you now check it yourself:
- View source. Open the page, view source, search for
hreflang. Confirm the tags are in the<head>, URLs are absolute, and the page lists itself. - Check the alternates. Open each alternate URL and confirm it returns 200, is indexable, is self-canonical, and links back.
- URL Inspection in Search Console. Use "Test live URL" and view the rendered HTML to confirm the tags survive JavaScript rendering. Compare the user-declared and Google-selected canonical for each version.
- Crawl the site. Desktop crawlers such as Screaming Frog or Sitebulb report missing return links, invalid codes and non-200 targets across the whole set.
- Spot-check tools. Google's documentation points to third-party testers such as the Merkle hreflang testing tool and Aleyda Solis's hreflang generator.
I add hreflang checks to every international audit, alongside the items in my technical SEO checklist.
Common hreflang errors and how to fix them
| Error | What goes wrong | Fix |
|---|---|---|
| Missing return tags | Page A lists B, but B doesn't list A. Google ignores the pair. | Output the same full set on every page in the cluster. |
| Missing self-reference | The page lists alternates but not itself. | Include the page's own URL with its own code. |
| Wrong codes | en-UK, en-EU, region-only IN, or swapped order GB-en. |
Use ISO 639-1 plus ISO 3166-1 alpha-2: en-GB, en-IN. |
| Pointing to redirected URLs | The alternate 301s elsewhere, so the link chain breaks. | Point to the final URL. See my 301 redirect guide. |
| Pointing to noindexed URLs | You ask Google to show a page you've told it not to index. | Remove noindex or remove the URL from the set. See noindex tag. |
| Pointing to non-canonical URLs | Hreflang lists ?ref= or non-slash versions, or regions canonicalise to one page. |
List only self-canonical URLs. |
| Relative URLs | href="/en-au/" instead of the full URL. |
Use fully qualified https:// URLs. |
Tags outside the <head> |
Broken HTML moves the tags into the body. | Validate the head; place hreflang high in it. |
| Auto-redirecting by IP | Users and Googlebot can't reach other versions. Googlebot mostly crawls from the US. | Don't force redirects. Suggest a version with a banner or selector instead. |
On that last row: Google's multi-regional guidance advises against automatically redirecting users between language versions and calls IP location analysis generally unreliable. Let people choose, and let hreflang handle search.
Site structure options in brief
Hreflang works with any URL structure, including across domains. Google's multi-regional guidance compares the main options:
- Subdirectories (
example.com/en-au/): easy to set up and maintain on one domain. This is what I use most for regional English sites. - Subdomains (
au.example.com): easy to set up, but users can't always tell if the prefix means language or country. - ccTLDs (
example.com.au): a clear country signal, but more cost and admin. - URL parameters (
?loc=au): Google says not recommended.
Choosing between them is a bigger international SEO decision. Hreflang is the same whichever you pick.
When you don't need hreflang
- One version of each page. A single English site that sells worldwide has no alternates to declare.
- Pages that aren't equivalent. Your Indian blog post about GST and your Australian post about BAS aren't versions of each other. Don't link them with hreflang.
- Only the header or footer changes. If the main content is identical, ask whether you need separate URLs at all.
- Machine-translated pages you wouldn't want indexed. Fix the content first.
Bing is a separate case. Bing's Fabrice Canel said in 2020 that hreflang is "a far weaker signal than content-language" at Bing (Search Engine Roundtable). If Bing traffic matters, also set the content-language value for each version.
FAQ
How do you pronounce hreflang?
Most SEOs say "H-ref-lang", spelling out the H and saying "ref" and "lang" as words. You'll also hear "href lang" without the H.
Does hreflang improve rankings?
Not directly. It doesn't add authority to a page. It helps Google choose which of your existing versions to show in each market, which can improve clicks and reduce duplicate clustering.
Can hreflang point to a different domain?
Yes. Google allows alternates on different domains, such as example.in and example.com.au. The same rules apply: absolute URLs, return links on both domains, and self-references.
Should I use hreflang on paginated or filtered pages?
Only where the equivalent page exists in every version and is indexable and self-canonical. If page 3 of a category exists only in the US version, leave it out of the cluster.
How long does it take for hreflang to work?
There is no fixed timeline. Google has to recrawl every page in the cluster to see the return links. Pages crawled often update sooner; deep pages can take weeks.
Is the HTML lang attribute the same as hreflang?
No. <html lang="en-GB"> describes the page you're on, for browsers and screen readers. Hreflang describes other versions of the page for search engines. Google uses neither to detect page language.
Sources
- Google Search Central: Tell Google about localized versions of your page
- Google Search Central: Managing multi-regional and multilingual sites
- Google Search Central: What is canonicalization
- Google Search Central: How to specify a canonical URL
- Search Console Help: The International Targeting report is deprecated
- Search Engine Land: Google Search Console to remove International Targeting report
- Search Engine Roundtable: Bing: Hreflang a weak signal for us
- WPML: Adding hreflang in WordPress
- Polylang: Hreflang tag attributes and Polylang
Connect with Akif on LinkedIn, Instagram and Facebook.
Driven by advanced SEO expertise, deep marketing analytics, high-impact content strategy
With 2+ years of hands-on SEO experience, I specialize in holistic search strategies that don’t just rank—they drive real, measurable business growth. I’ve worked across industries including healthcare, hospitality, legal, e-commerce, and professional services, helping brands dominate their target markets. My approach bridges the gap between raw data and creative execution. Every strategy I build is rooted in rigorous market analysis, structured SEO frameworks, and tailored content ecosystems—no templates, no shortcuts. Whether you’re a single-location brand or scaling across multiple cities, I create data-driven marketing systems designed to compound results and grow with you.
Running Your Site in More Than One Country?
Get an international SEO review covering hreflang, site structure and duplicate content.
Book a Free SEO Audit →