If your site serves multiple languages or regions, hreflang tags tell Google which version to show to which searcher. Get them wrong and you risk the wrong country's page ranking — or none of them ranking at all.
Hreflang is an HTML attribute that tells search engines which language and, optionally, which regional variant of a page a given URL is intended for. If you publish the same content in English for the US and the UK, or in English and Spanish, hreflang is how you tell Google "show this version to searchers in this locale" instead of letting it guess — and Google's guesses about regional intent are frequently wrong without an explicit signal.
Hreflang annotations live in the <head> of each page, with one line per language/region variant, including a self-referencing entry for the current page:
<link rel="alternate" hreflang="en-us" href="https://example.com/" />
<link rel="alternate" hreflang="en-gb" href="https://example.com/en-gb/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />
The language code is required (ISO 639-1, e.g. en, es, fr); the region code is optional and uses ISO 3166-1 Alpha 2 (e.g. us, gb, mx). en-us means "English, as spoken in the US" — it does not mean "the US version regardless of language." x-default is a special value for the fallback page shown when no other variant matches the visitor's settings.
Every hreflang annotation must be reciprocal. If your English page links to the Spanish page via hreflang, the Spanish page must link back to the English page via hreflang too. If the link only goes one direction, Google ignores the annotation entirely — not just on the broken side, but often across the whole cluster. This is the single most common cause of "my hreflang tags aren't working," and it's almost always caused by one language version being updated or added without going back and updating every other variant's annotation list.
hreflang="us" is invalid; us is a region code, not a language code, and must be paired with a language: en-us.Hreflang can be declared either as <link> tags in the page head (shown above) or as entries inside your XML sitemap, using <xhtml:link> elements nested under each <url>. The sitemap method is usually easier to maintain at scale — for ten language variants of a hundred pages, that's a thousand reciprocal head-tag entries to keep in sync by hand, versus one centrally generated sitemap file. Pick one method per URL set; mixing both for the same pages is allowed by the spec but adds a second place every annotation has to stay correct.
Use Google Search Console's International Targeting report (where available) or fetch the live page and check the rendered <head> for the reciprocal pairs directly — a quick way to catch a broken or missing back-link before Google's next crawl surfaces the problem in production. If you're also managing a separate XML sitemap for these URLs, see our XML sitemaps guide for what else belongs in it alongside the hreflang annotations.
No sign-up required — use them instantly in your browser.