What is the Hreflang Tag?
The hreflang tag (also known as rel="alternate" hreflang="x") was invented by Google in 2011. The hreflang tag tells Google which languages a site’s page is offered in, allowing a search engine to point potential visitors to the most relevant page for their language. Currently, only Google and Yandex support the hreflang tag. Alternatively, Bing uses meta tags for language.
Why is the Hreflang Tag Useful for a Site?
The hreflang tag is beneficial for localized pages which change due to language or region for the visitor or via redirects. By providing a localized experience, a webmaster can increase the user experience (UX) by ensuring the visitor will be directed to the landing page which best suits them.
Due to the hreflang tag, the Polish page will show up in the search engines and when the Polish user clicks on that result, they will be directed to the Polish version of the page.
Take a look:
Keyword: SEO Software
Results in Google.com:
Results in Google.pl:
When Does a Webmaster Use the Hreflang tag?
- A fully translated website
- Using one language on the main content, but translated the website’s template (ex. navigational buttons)
- User-generated content that can appear in different languages, like forums
- Having the same language, but the content is regional (ex. UK vs US English)
How to use the Hreflang Tag:
The hreflang tag is part of the coding on your site. You must ensure that each page is setup correctly to have the hreflang tag considered as a signal for Google.
Code example of the hreflang tag:
<link rel="alternate" href="http://websiteexample.com/ " hreflang="fr" />
Let’s say that you have a site, http://websiteexample.com, which is entirely in English. You have fully translated this site into French. By placing the hreflang tag in the header of the on-page markup, the HTTP header or sitemap, you can indicate to Google and Yandex that this site has more than one language.
Header of On-Page Markup:
Use a link element to direct to the French version of that webpage within the section of the HTML markup, like this:
<link rel="alternate" hreflang="fr" href="http://websiteexampe.com/fr/" />
With non-HTML files, like PDFs, use an HTTP header to show different languages:
Link: <http://websiteexample.com/fr/>; rel="alternate"; hreflang="fr"
Webmasters can use their Sitemap to submit the language versions. Google has given an excellent outline of the best practices for using the hreflang tag with Sitemap.
Using Different or Regional Languages on a Site’s Page
For different or regional languages, a webmaster must identify all languages which the site supports. If the homepage allows users to select a language, or it redirects based on a visitor’s location, a webmaster should use the hreflang pointing to the value “x-default.”
For example, Unamo’s supports supports English, Polish, Turkish, German, and Spanish. Unamo puts the languages in the header on the on page markup. Take a look at how it’s done:
Supported Languages and Regions
The hreflang tag uses languages codes in the ISO 639-1 and region codes in the ISO 3166-1 Alpha 2 format.
Hreflang and Canonicalization
At first, the hreflang tag and canonical tag can sometimes cause confusion because they both serve similar functions, and they let Google know which URL with similar content to index. However, there is a slight difference between the two. The hreflang tag tells the search engine which similar content page should show up in a search engine, based on region or language. A canonical tag tells the search engine which URL with similar content has more weight - thus avoiding the issue of duplicate content.
However, Google does not recommend using the hreflang tag with the canonical tag for different languages or countries. A webmaster should only use the canonical tag for content within the same language/country.
The Benefits of the Hreflang Tag
The hreflang tag will increase your UX, which likely leads to a lower bounce rate and increased conversions. It is important to note that the hreflang tag will not ensure ranking success - it is simply one of many signals. International SEO is a unique and complex subfield of SEO that has many intricate parts.