Hreflang is a piece of code that you add to a webpage that tells search engines which language that page is in. This will help search engines to serve that page to users of the same language.
Adding a hreflang tag to a page is especially important when a page appears in many different languages. When a page appears in many languages, the hreflang tag should also include links to the versions of the page in different languages.
Hreflang implementation is considered one of the more difficult page markups, so I would highly recommend:
- Reading Google’s original guide on localisation
- Using this hreflang tag generator from Aleya
- Checking your results with this validator from Dejan
- Hreflang should be used in conjunction with canonicalization tags. Each language variant of a page should have a self-referential canonical tag so that search engines know that it is the ‘real’ version of the page for that language.
- Make sure to use the correct language markup. For a full list of Hreflang language codes, see this resource from Martin Kura.
- Make sure to have a hreflang alternate setup for ‘everywhere else’. So if you have an English, French, and Spanish version of a page, you should also designate one of them as the default page by using the code: <link rel=”alternate” href=”http://example.com/” hreflang=”x-default” />