hreflang is an HTML attribute that tells search engines the language and region of a page. It links language or regional variants of the same content to one another.
The signals to search engines which language and region a page is intended for, and connects equivalent language or country versions of a page. This lets Google serve users the appropriate variant, for example a German page for Switzerland instead of an English version.
hreflang is specified as an annotation in , the markup language for web pages, or in the . Each variant should reference all the others and point back to itself.
de-ch for German in Switzerland,
fr-ch for French in Switzerland,
en for a language-general English version.
Correctly set hreflang annotations help avoid across language versions and show the right page in the appropriate search results. Faulty or one-sided annotations, by contrast, can cause confusion in how pages are matched.