Hreflang is implemented by adding an annotation — in a page's HTML, an HTTP header, or an XML sitemap — to every language or regional version of a page, with each version listing itself plus every other version, so search engines can show a searcher in Madrid the es-es page and a searcher in Mexico City the es-mx page instead of whichever version happens to rank by accident. Get the syntax and the reciprocal links right, and international and multilingual sites stop competing with themselves across markets.
Hreflang is also one of the most error-prone parts of technical SEO precisely because it fails silently: a broken tag doesn't throw an error, it just gets ignored, and the wrong page keeps showing up in the wrong country indefinitely. This guide covers what hreflang actually does, the three valid ways to implement it, the mistakes that cause most real-world setups to break, and how to audit a setup before it costs you international visibility.
What hreflang actually does and when you need it
Hreflang is an annotation that tells Google which language and, optionally, which regional version of a page to serve a given searcher, so equivalent pages in different languages or locales are treated as intentional variants rather than duplicate or competing content. It does not translate anything or influence rankings directly — it only routes searchers to the right existing page.
You need it when your site keeps the core content in one language but swaps the template, when you run near-identical content with small regional differences in a single language — such as English pages targeted separately at the US, UK and Ireland — or when content is fully translated into multiple languages, per Google's own guidance on localized pages. A single-language, single-market site simply doesn't need it. Sites built around genuinely regional content also benefit from pairing hreflang with the kind of location-specific signals covered in local SEO work.
The three ways to implement hreflang
You can implement hreflang in a page's HTML head with link elements, in an HTTP header for non-HTML files like PDFs that have no head section, or inside an XML sitemap that lists every URL's alternates in one place — Google reads all three identically, so the choice is about scale and maintainability, not ranking advantage.
HTML tags work fine for a handful of regional pages but get unwieldy fast, since every page must carry a tag for every other version. For a site with more than a few language or regional pairs, a sitemap-based implementation is usually easier to generate programmatically and easier to audit, and it keeps the annotations out of your on-page SEO markup entirely. Whichever method you pick, use it consistently sitewide rather than mixing methods across sections.
- HTML: <link> tags in the <head> of each page, pointing to every language/region variant
- HTTP header: the same link syntax sent as a response header, for PDFs and other non-HTML files
- XML sitemap: one centralized file listing every URL's full set of alternates
Get the reciprocal return-tag rule right
Every page in a hreflang set must link to every other version, including a self-referencing tag pointing back at itself, because a one-directional hreflang annotation that isn't returned by the page it points to is simply ignored by Google rather than flagged as a visible error. This is the single most common way real hreflang implementations break.
It is also, by the numbers, a widespread problem: Ahrefs' study of over 374,000 domains found that more than two-thirds of sites using hreflang had at least one implementation issue, and missing return tags are consistently among the top causes. The failure mode is quiet — nothing in your rankings dashboard says 'hreflang broken' — so the only way to catch it is to actually crawl and cross-check every version against every other.
Use x-default and the right language-region codes
x-default marks the fallback page shown to visitors who don't match any of your targeted language or region codes, and it matters most on sites with a language-selector landing page or a generic global homepage with no single default market. Skipping it just means Google picks a fallback on your behalf, which is rarely the page you'd choose.
The codes themselves are a second, equally silent failure point: use ISO 639-1 for language and ISO 3166-1 Alpha-2 for country, lowercase and hyphenated as in en-us or fr-ca, and never invent a code or swap the order. Semrush's breakdown of common hreflang errors finds invalid or inconsistent codes among the most frequent issues it sees in site audits, right alongside missing return tags.
- x-default for a language-selector page or global fallback, where relevant
- Language-only codes (en, fr, es) when regional variants don't matter
- Language-region codes (en-gb, en-us) only when the regional distinction is real
- Fully-qualified URLs in every annotation, including the https:// scheme
Don't let canonical tags cancel out your hreflang setup
Hreflang and canonical tags solve different problems and will contradict each other if combined carelessly: canonical tells Google which URL is the master copy of duplicate content, while hreflang tells Google which equivalent page to serve in which locale. Every page in a hreflang set should canonicalize to itself — pointing a translated page's canonical tag at the original-language version instead cancels out the hreflang signal you just set up.
This mistake is common on sites that added hreflang after already having a canonicalization strategy built for a single-language site, and nobody revisited the canonical logic once regional pages existed. Google's guidance on managing multi-regional and multilingual sites is explicit that each localized page needs its own self-referencing canonical alongside the hreflang set, not a canonical pointing elsewhere.
How to audit and maintain your hreflang setup
Audit hreflang by crawling every tagged URL, confirming each one returns the reciprocal link back from every page it points to, resolves with a 200 status rather than a redirect or 404, and canonicalizes to itself — then re-run that check after every migration, redesign or new-market launch, because hreflang breaks silently and nothing in Search Console will proactively tell you it did.
Most crawler tools used for a broader technical SEO audit include a dedicated hreflang validation report that flags missing return tags, bad codes and canonical conflicts in one pass. Treat that check as a standing item rather than a one-time setup task — it is exactly the kind of recurring technical review that belongs in ongoing SEO consulting, especially for any site actively expanding into new markets or adding translated content through a dedicated SEO content writing process.
Sources
- Google Search Central — Tell Google About Localized Versions of Your Page
- Google Search Central — Managing Multi-Regional and Multilingual Sites
- Ahrefs — Over 67% of Domains Using Hreflang Have Issues (Study of 374,756 Domains)
- Semrush — What Is Hreflang and How Does It Work?
- Semrush — 9 Common Hreflang Errors (and How to Fix Them)
Related services
Try the free Link Gap Calculator
See roughly how many quality backlinks you need — and how long it takes — to rank for your keyword on Google and in AI search engines.
Open the Link Gap Calculator →The UMM SEO Editorial Team
SEO strategy & link building
Written and fact-checked by the UMM SEO team — the strategists, link builders and content specialists who run real SEO campaigns for clients every week. Our guidance comes from hands-on backlink building, technical and on-page SEO, content and digital PR work, not from theory.