If you serve different content based on a user's language or region, use
to ensure that search engines serve the correct content for that language or region.
hreflang link for each language version of a URL. Lighthouse flags in your report any
hreflang links that it has found.
Suppose that you have 3 versions of a page:
- An English version at
- A Spanish version at
- A German version at
Tell search engines that these pages are equivalent by adding
link elements to the
<link rel="alternate" hreflang="en" href="https://example.com" /> <link rel="alternate" hreflang="es" href="https://es.example.com" /> <link rel="alternate" hreflang="de" href="https://de.example.com" />
Or by adding
Link headers to your HTTP response:
Link: <https://example.com>; rel="alternate"; hreflang="en", <https://es.example.com>; rel="alternate"; hreflang="es", <https://de.example.com>; rel="alternate"; hreflang="de"
Or by adding language version information to your Sitemap.
For pages that allow users to select their language use the
<link rel="alternate" href="https://example.com" hreflang="x-default" />
Each language page should specify all the different language versions, including itself.
Pages must always link to each other. When page A links to page B, page B must also link
back to page A, or else search engines may ignore the
hreflang links or interpret them
hreflang value must always specify a language code. The language code must follow
ISO 639-1 format. The
hreflang value can also include an optional
regional code. For example,
en-ie is for English speakers in Ireland, whereas
es-ie is for
Spanish speakers in Ireland. The region code must follow ISO 3166-1 alpha-2
Lighthouse only checks for valid language codes. It does not check for valid region codes.
Lighthouse checks for
hreflang links in the page's
head and in its response headers.
Lighthouse does not check your Sitemap.