Skip to content
Searchpedia SEO field notes Callum Bennett Callum

Site ops

Hreflang Implementation

If you serve the same content in multiple languages or regions, hreflang is not optional — it stops Google from treating your pages as duplicates or showing the wrong version to users.

Beginner3 min readUpdated 2026-07-27Notes by Callum Bennett

Start here

  • Check if your site serves the same content in multiple languages or regions; if yes, implement hreflang to avoid duplicate content and wrong-language rankings.
  • Choose one implementation method—HTML link tags, XML sitemaps, or HTTP headers—and apply it consistently across all pages.
  • Include a self-referencing hreflang tag on every page and ensure all URLs in the cluster are reciprocal: each page must link to every other variant.
  • Use absolute URLs, verify each page returns a 200 status, and test with Google Search Console or a dedicated hreflang validator after deployment.

Plain-English take

Hreflang is a signpost for search engines. Imagine you sell shoes from a site that has a UK page with prices in pounds and a US page with prices in dollars. The product descriptions are otherwise identical. Without hreflang, Google might serve the UK page to someone in New York, or treat both as [duplicate content](/duplicate-content/) and push one out of the index. Hreflang tells Google that this URL is for UK users and that URL is for US users.

You specify a language code (e.g. en) and optionally a region code (e.g. GB for Great Britain). Every page in the set must list every other variant, including itself — that self-referencing tag feels redundant, but Google requires it. I recommend using ISO 639-1 language codes and ISO 3166-1 Alpha-2 region codes. For a fallback when no language or region matches the user, use x-default.

I prefer implementing via XML sitemaps because it keeps markup out of the HTML <head> and is easier to audit across large sites. But HTML <link> tags work fine for smaller sets. The key is consistency: pick one method and apply it everywhere. Without reciprocity your cluster breaks. I once audited a site with 50 products in 4 languages — 200 pages. They only linked variants from the main English page. Google indexed none of the alternate language pages for two months. Hreflang is a strict reciprocal promise: if page A links to B, B must link back to A.

When it actually matters

Hreflang matters when your site has any of these patterns:

  • Same content in different languages. A product page translated into Spanish, French and German. Without hreflang, Google might see these as separate pages about the same thing and pick one canonical — often the English version — hiding the alternatives from French or German searchers.
  • Same language for different regions. A blog in English targeted at the US, UK, and Australia with region-specific spelling or currency. If you don't use hreflang, a user in Australia might see the UK version with pounds instead of dollars, or Google may treat them as [canonical tags](/canonical-tags/) and collapse them into one.
  • Near-identical landing pages that differ only by country. Think /uk/ and /us/ for a global brand. The content is 95% the same. Hreflang prevents Google from flagging these as duplicate content and picking one to rank for all regions.

If your site fits any of these, hreflang is not optional. In one case I worked on, 30% of organic traffic to a French site was coming from users in Quebec, but the page was en-CA not fr-CA. After fixing hreflang, that traffic tripled. The decision rule is: if you expect a user in one region to see a different page than a user in another region, and those pages share substantial content, you need hreflang. It is part of [technical SEO](/technical-seo/) that directly affects international search visibility and user experience.

What I got wrong

I made several mistakes early on, and each one cost traffic.

Missing reciprocal links. I once had a cluster where page A linked to B and C, but B only linked to A. Google ignored the whole set. Every page must link to every other page in the cluster. The easiest way to check is to run an [SEO audit](/seo-audit/) that crawls hreflang annotations and flags non-reciprocal pairs.

Forgetting self-referencing tags. Each page needs a tag pointing to itself. It feels redundant — why tell Google that this page is an alternate version of itself? — but Google requires it. I skipped it on a set of 200 pages and only the page that had itself listed got indexed. The entire international expansion was invisible for six weeks.

Using relative URLs. I used href="/fr/" instead of a full absolute URL. Google ignored them. Always use the full protocol and domain, and make sure the target URL returns a 200 status — not a [301 redirect](/301-redirect/) or a 404. I now run a monthly script that hits every URL in each cluster and checks for HTTP status, self-referencing, and reciprocal links. Also, if you serve hreflang via HTTP headers for PDFs, remember to include the header on the PDF itself, not just on the landing page. I broke that too.

Next step

Quick answers

What is x-default and when should I use it?

x-default is a fallback hreflang value for when no language or region matches the user's settings. Use it on a generic landing page, such as a language selector homepage. For example, if a user in Japan visits a site with only English and French, x-default helps Google show the language selector instead of guessing. It is not required but strongly recommended for global sites.

Can I use hreflang with JavaScript-rendered pages?

Yes, but only if the hreflang links are present in the initial HTML response or injected before rendering. Googlebot can process JavaScript, but it is slower and may not always see dynamically inserted link tags. Safer to include hreflang in the server-side HTML or use XML sitemaps. I avoid relying on JavaScript for hreflang.

How do I test if my hreflang implementation is correct?

Use Google Search Console's URL Inspection tool to see the detected hreflang for a page. Alternatively, third-party tools like Merkle's Hreflang Tag Checker or Ahrefs' webmaster tools can scan a set of URLs. I run a manual check on a sample after every site update. Look for missing self-referencing tags, broken links, and non-reciprocal clusters.

Sources

Primary documentation is linked directly. Anything commercial is marked nofollow.

Notes from Callum Bennett.