


We use cookies to improve your experience
We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience.
Definition
Hreflang is an HTML attribute that tells search engines which language and regional version of a page to show to users in different countries. It prevents duplicate content issues between language versions and ensures French users see the French page, Spanish users the Spanish page, etc.
The hreflang attribute is implemented as link tags in the page head: . Each page should have hreflang tags for all its language/region variants, including a self-referencing tag. An x-default hreflang serves as the fallback for users not matched by any specific language tag.
Hreflang uses ISO 639-1 language codes (en, fr, de, es) optionally combined with ISO 3166-1 country codes (en-US, en-GB, fr-CA, pt-BR). This allows targeting both language and region — important when the same language has regional variations (British vs. American English, Brazilian vs. European Portuguese).
Implementing hreflang correctly is notoriously difficult. Common mistakes include: missing return links (page A links to page B, but B does not link back to A), incorrect language codes, mixing hreflang implementations (link tags, HTTP headers, and sitemap), and forgetting the x-default tag. Google Search Console reports hreflang errors that should be monitored and fixed. For large multilingual sites, managing hreflang in XML sitemaps is often more maintainable than individual page tags.