Search all pages  ·  Press Esc to close  ·  ↑↓ to navigate
Content Strategy Local SEO GMB Prompts Technical SEO E-E-A-T Guest Post GA4 Analytics
Technical SEO · AlgoBlueprints · November 2026

What is hreflang? A practical guide to hreflang tags

Add as Preferred Source on Google
Table of Contents

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

What does hreflang mean?

Marketer pointing at a world map with coloured pins on an office wall, with the headline What Is Hreflang?
Hreflang tells Google which version of a page suits each language and region.

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?

Airport departures board with travellers walking past with suitcases
Like a departures board, hreflang sends each visitor to the right destination.

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:

  1. Self-reference. Each version must list itself as well as every other version.
  2. 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.
  3. Fully qualified URLs. Every href must be absolute, including https://. Alternates can sit on different domains.

Two points people get wrong:

When to use hreflang

Woman comparing two versions of an online store on a laptop and a tablet
Regional versions of the same page are where hreflang matters most.

Use hreflang when you have equivalent pages that differ by language, region, or both:

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?

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:

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:

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:

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:

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:

  1. 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.
  2. Check the alternates. Open each alternate URL and confirm it returns 200, is indexable, is self-canonical, and links back.
  3. 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.
  4. 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.
  5. 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:

Choosing between them is a bigger international SEO decision. Hreflang is the same whichever you pick.

When you don't need hreflang

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

Akif Qureshi
Akif Qureshi
Senior SEO Specialist & Marketing Analyst | Content Strategist

Connect with Akif on LinkedIn, Instagram and Facebook.

2+ yrs in SEO Google & HubSpot certified 120+ guides

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.

No sponsored content No affiliate links Reader supported

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 →

Related guides

More SEO guides →

© 2026 Algoblueprints. All rights reserved.