Implement hreflang links
The main method to indicate localized versions of a page to Google is by using the hreflang attribute. The hreflang link tells Google what is the preferred page for a specific language or country.
The hreflang link element includes three fragments:
1. rel=”alternate”, which specifies the existence of an alternative URL.
2. hreflang=”lang_code”, where “lang_code” is a supported language/region code targeted by the version of the page.
3. href=”url_of_page”, where “url_of_page” is the URL version for the specified language/region.
For example, suppose that you have 3 versions of a route page:
- An English version for the United States at https://airline.com/en-us/flights-to-new-york
- A Spanish version for Mexico at https://airline.com/es-mx/vuelos-a-nueva-york
- A German version for Germany at https://airline.com/de-de/fluge-nach-new-york
There are three ways to use the hreflang attribute: