What is the Purpose and Value of the Hreflang Tag?
What is the use of the hreflang tag?
The hrefLang tag is used to tell Google the language that you are using on a specific page. This helps Google return results to users that are most likely to match their needs, based upon their location. For example, if you wanted to create a French version of your website, then you would include hreflang=”fr”. Google would then know to show this version of the website when displaying results to a customer in a French speaking country.
You can also use the tag to specify regions where the content has been localized for the audience. For example, if you had Spanish content that was localized for Spain, you would include hreflang=”es-es”, while Spanish content for Mexico would be written hreflang=”es-mx”.
How important is hreflang?
With the hreflang tag, you are able to create localized pages for different languages and locations to get the correct information into your customers hands. If you have separate offerings for customers in Spain versus Argentina, you need to have a way to let Google know which site is for which country.
How do I add hreflang?
To generate the tag, you need to carefully watch your language and country codes. For example uk is used to indicate Ukraine and Ukrainian, not United Kingdom. If your content is for England, then you use gb, which is for Great Britain.
There are generators that will help you spit out the code you need, or you can create it yourself by using the language code from the ISO 639-1 format or the country codes from the ISO 3166-1 Alpha 2.
This tag goes in one of three places:
- Your site map
- The HTTP header
- The on-page markup
You only need to include it in one place. It is important to note that Google and Yandex both recognize this tag, but Bing does not.
The Hreflang tag offers website developers considerable control over the localization of their site internationally. If you have a site that will need to serve customers from different counties, this is a valuable tool to use to get started.