Hreflang Tags Explained: Multilingual SEO Without the Headaches

Flat vector illustration of a globe with language speech bubbles showing how hreflang tags work

If your website serves customers in more than one language — or the same language across different countries — hreflang tags decide which version of each page Google shows to each searcher. Done right, your French visitors land on French pages with local pricing. Done wrong, Google may ignore your annotations entirely, and your carefully translated pages will compete against each other or never appear at all. The concept takes ten minutes to grasp; the execution takes discipline. Audits regularly find the majority of sites using these annotations carry at least one error, and a single broken link in the chain can get the whole cluster discarded. This guide covers what the tags do, how to implement them with real code examples, the mistakes that silently break them, and a repeatable audit routine. What Are Hreflang Tags? The Simple Definition Hreflang tags are small HTML attributes that tell search engines which language and regional version of a webpage to show a user, based on their language preferences or location. A typical annotation block looks like this: <link rel=”alternate” hreflang=”en-us” href=”https://example.com/pricing/” /> <link rel=”alternate” hreflang=”en-gb” href=”https://example.co.uk/pricing/” /> <link rel=”alternate” hreflang=”fr-fr” href=”https://example.com/fr/tarifs/” /> <link rel=”alternate” hreflang=”x-default” href=”https://example.com/pricing/” /> Three pieces make up every annotation: rel=”alternate” marks the target as an alternate version of the current page, hreflang names the language (and optionally the region) that version is written for, and href gives its full URL. The identical block appears on every page in the group. The tags do not tell Google what language a page is in — Google determines that itself. They only say these pages are versions of each other, and which audience each version belongs to. Why These Annotations Matter for International Sites Without them, Google sees your English, French, and Spanish versions of the same page as near-duplicates and guesses which one deserves to rank for whom. Your US page may outrank your UK page for British searchers, or your translations may cannibalize each other. With the tags in place, Google treats the group as one cluster sharing ranking strength and swaps in the best-matching version for each searcher. The business case is concrete: visitors who land on pages in their own language with local pricing and shipping details bounce less and convert more. There is also a compounding SEO benefit — because the cluster consolidates ranking signals, strong backlinks to one version lift the whole group instead of being split across competing duplicates. Remember that hreflang tags are a hint, not a command. Google can override them when other signals disagree, which is exactly why flawless mechanics matter. How Hreflang Tags Work: The Three Rules Everything in hreflang implementation rests on three rules. Violate any one and Google may discard your annotations. 1. Every page must reference itself Each page in the group must include an annotation pointing to its own URL. This self-reference confirms the page’s intended audience to Google. Omitting it is one of the most common audit failures on the web. 2. Annotations must be bidirectional If your English page points to your French page, the French page must point back with the complete, identical block. Missing return links are the single most destructive error: without reciprocity, Google cannot confirm the relationship and may ignore the entire cluster. When you launch a new language, update every existing version — not just the new page. 3. Define a fallback with x-default hreflang=”x-default” names the fallback page for searchers matching none of your annotations — usually the global English version or a language-selector page. Include it on every page in the cluster so you control the default experience. Writing Correct Hreflang Values Invalid codes are the largest single source of errors, and they fail silently — Google ignores annotations it cannot parse. The language code is required and comes from ISO 639-1 (two lowercase letters: en, fr, ar, zh). The region code is optional and comes from ISO 3166-1 Alpha-2 (two uppercase letters: US, GB, MX). Format is always language first, region second, hyphen-separated: en-GB, never GB-en or en_GB. en-UK is wrong. British English is en-GB; Google ignores en-UK. Japanese is ja, not jp. jp is the country code; use ja or ja-JP. A bare region code is invalid. You may use a language alone (es) but never a region alone — hreflang=”mx” gets ignored. No city codes. Regions are countries only: ar-AE, never ar-dubai. One annotation per language-region. Never assign two URLs to the same value on one page. Do not over-specify regions. A single Arabic page should be tagged ar, not ar-AE — the narrower tag tells Google the page is for the UAE only. Add region codes only for genuinely separate country pages, and keep a generic language fallback alongside them. Implementing Hreflang Tags: The Three Methods Google accepts the annotations in three places and treats them equally. Pick one per site — mixing methods multiplies the surfaces for mistakes without any benefit. Method 1: Link elements in the HTML head The simplest option for small sites: the full block goes in the <head> of every version. Easy to inspect, but template changes can silently drop the tags, and JavaScript-injected tags are unreliable. Best for a handful of locales on a server-rendered CMS. Method 2: XML sitemap The recommended method for large sites. Annotate each page’s alternates inside the sitemap with the xhtml namespace, keeping all logic in one centrally managed file: <url> <loc>https://example.com/pricing/</loc> <xhtml:link rel=”alternate” hreflang=”en-us” href=”https://example.com/pricing/” /> <xhtml:link rel=”alternate” hreflang=”en-gb” href=”https://example.co.uk/pricing/” /> <xhtml:link rel=”alternate” hreflang=”x-default” href=”https://example.com/pricing/” /> </url> This scales to thousands of pages, generates programmatically from your database, and is the only sane choice for cross-domain setups. Method 3: HTTP response headers Reserved for non-HTML files such as PDFs, where no <head> exists. The server emits a Link header carrying the same annotations, configured at the server or CDN level. Rarely the primary method — but if your PDFs rank internationally and lack it, those files sit outside your hreflang logic. Whichever method you choose: use absolute HTTPS URLs,