Technical SEO
hreflang
An annotation that tells search engines which language and region version of a page to show to which users on international or multilingual sites.
By Shimon Carroll, Founder, SEO for AI Agents · Last updated
hreflang is the mechanism for telling search engines about language and regional variants of a page. If you have an English page for the US, an English page for the UK, and a German page for Germany, hreflang annotations connect them so Google serves the right version to the right user and does not treat them as duplicate content competing against each other.
The annotations can live in the HTML head, in HTTP headers, or in the XML sitemap, and they must be reciprocal: if page A declares page B as its German alternative, page B must declare A back. Each variant should also include a self-referencing hreflang, and a common pattern adds an x-default entry for the fallback when no language matches. The language and region codes follow ISO standards (language in ISO 639-1, optional region in ISO 3166-1 Alpha 2).
hreflang is notoriously easy to get subtly wrong: missing return tags, mismatched URLs, wrong region codes, or canonicals that conflict with the hreflang set. Because the errors are silent (the site still works, it just serves the wrong variant), validation matters. We check reciprocity, self-reference, code validity, and conflicts with canonical tags.
Related terms
Primary sources
- Google Search Central, localized versions of your pages
Google Search Central