Definition
hreflang is an HTML attribute that tells search engines which language and regional version of a page to serve to a given user. It is used on sites that publish the same content in multiple languages or for multiple regional markets.
When a French-speaking user in France searches for a product, hreflang helps Google pick the fr-FR version of your page rather than the Canadian French or US English one.
Syntax
The most common placement is a set of <link> tags in the <head> of every language variant:
<link rel="alternate" hreflang="en-US" href="https://example.com/us/product" /> <link rel="alternate" hreflang="en-GB" href="https://example.com/uk/product" /> <link rel="alternate" hreflang="fr-FR" href="https://example.com/fr/produit" /> <link rel="alternate" hreflang="de" href="https://example.com/de/produkt" /> <link rel="alternate" hreflang="x-default" href="https://example.com/product" />
The value is an ISO 639-1 language code, optionally followed by an ISO 3166-1 Alpha 2 region code (e.g. en, en-US). The special x-default value marks the page to serve when no other language matches the user.
The Reciprocity Rule
Every page that is part of an hreflang cluster must include the full set of annotations — including a self-referencing one. If the en-US page lists the fr-FR version, the fr-FR page must also list the en-US version.
Google ignores unreciprocated annotations. This is the single most common hreflang bug at scale: a partial rollout where new language variants list older ones but older pages have not been updated.
Where to Place hreflang Annotations
Three equivalent methods — Google supports all three, and they should not be mixed:
- —HTML
<link>tags in the head of each HTML page. Easiest for small sites. - —HTTP
Linkheader. The only option for non-HTML resources like PDFs. - —XML sitemap
<xhtml:link>entries. Most scalable for large multilingual sites — one sitemap contains all language mappings and is easier to maintain.
Common Mistakes
Using invalid or non-ISO codes
Google expects strict ISO values. en-UK is invalid — use en-GB. en-US-en is malformed. Typos silently cause the annotation to be ignored.
Pointing to redirected or non-200 URLs
hreflang targets must resolve directly to the final URL with HTTP 200. A target that 301-redirects is still honoured by Google but adds crawl overhead and is treated as a soft warning in Search Console.
Missing x-default
Without an x-default, users whose language does not match any of your variants may be served a random one. The x-default should point to your global or English-US homepage.
Conflicting canonicals
Each language variant must self-canonicalise. If the fr-FR page carries a canonical pointing to the en-US version, hreflang and canonical contradict each other and Google ignores both signals.
How Seoxpert Validates hreflang
The scanner validates hreflang clusters across every crawled page:
- —Missing reciprocal annotations (page A → B but not B → A)
- —Invalid language or region codes that will be silently ignored
- —Targets that redirect or return non-200 status codes
- —Missing or duplicate x-default entries
- —Conflicts between hreflang targets and canonical tags
See related: canonical tag → · most common technical SEO mistakes →