If you have an audience in different countries around the world, your website – and digital marketing efforts – will benefit from using hreflang tags.
The hreflang attribute tells Google which language and country you are targeting for a specific page. This allows the search engine to serve the page result to users searching in that specific language and country.
Think of the hreflang tag this way: when a user searches in language x, the hreflang tag ensures the search result is also delivered in language x, rather than language y or z.
At its core, the hreflang tag is all about creating a great user experience.
It is important to note, an hreflang tag acts as a signal to search engines, not as a directive. Google’s knowledge base does say that even if you don’t use the hreflang attribute, the Google search engine:
“... might still find alternate language versions of your page, but it is usually best for you to explicitly indicate your language- or region-specific pages.”
Now, let’s be real: if Google says it’s best to explicitly indicate your language- and region-specific web pages, you should do it. To help with the sometimes complex technical SEO effort of hreflang implementation, this post has been designed as a guide to answer questions about hreflang tags, including:
Doing hreflang may not be easy – it requires process and patience – but when done right the benefits for brands with international websites and their audiences are immense.
The hreflang tag is a snippet of code that tells Google which language to use when serving search results to a geo-targeted audience. You may also see it referred to as:
rel="alternate" hreflang="x"
The code enables an international website to serve results based on the search language or searcher’s location.
Code Sample:
<link rel="alternate" href="http://example.com" hreflang="en-us" />
This code tells Google that this English version of the page is specifically directed to a U.S. audience.
The hreflang tag makes sense for any brand doing global SEO when:
AND/OR
<link rel=”alternate” href=http://example.com/ hreflang=”en” />
<link rel=”alternate” href=http://example.com/ hreflang=”en-gb” />
<link rel=”alternate” href=http://example.com/ hreflang=”en-au” />
The hreflang tag gives your content a global SEO boost. Like canonical tags, hreflang helps to avoid penalties associated with duplicate content across global sites. In addition to having content in multiple languages, you can also have content targeted towards variants of a single language. This allows you to localize your content for a specific language region. For example, using the hreflang=”es-es” signifies Spanish for Spain rather than hreflang=”es-mx”, which signifies Spanish for Mexico.
Currently, Google and Yandex use the hreflang tag, but Bing and Baidu do not. Bing and Baidu do not have an equivalent, but they do support content-language HTML attributes and language meta tags.
Hreflang gives your content a global SEO boost. In addition to having content in multiple languages, you can also have content targeted towards variants of a single language. This allows you to localize your content for a specific language and region.
Ultimately, you want to use hreflang for these two reasons:
Although duplicate content is a serious SEO issue, for brands doing Global SEO the value of delivering content to an audience in their language with regionally targeted products and offers cannot be overstated in terms of user experience and as a revenue driver.
Hreflang tells a search engine which page to show a user based on language or region. Canonicalization tells the search engine which version of a URL to index when those different versions of a URL contain the same content.
You can use language annotations in one of three different ways:
Recommended Reading: 4 Steps to Create an XML Sitemap with Hreflang Tags
Regardless of which method you use, an hreflang tag should always be used on absolute URLs.
In instances when you do not have a language or region that matches a user’s browser setting, you would use:
hreflang=”x-default”
Using this value lets you control the user experience by letting you direct the user to the preferred page, such as your site’s homepage where the user can select their language or region of choice.
You can also find several third-party tools. One of the most popular is Aleyda Solis’ hreflang Tags Generator Tool.
Some other ways to fix and/or prevent errors from popping up include:
seoClarity's site audit technology, Clarity Audits, allows you to crawl your site and extract all the accompanying hreflang tags that are currently on your site to address the errors. Our built-in crawler identifies which pages may have hreflang tag issues.
You have the option to crawl and check for issues related to implementation in hreflang on the page, and issues that can be found by crawling the hreflang URLs.
Once the crawl is complete, review the audit in Clarity Audits, or get more granular with the information in Site Health.
In addition, our SEO Professional Services team is also available to diagnose any issues you may be having with your site.
One of the biggest mistakes coders make is failing to use a valid hreflang tag. Watch out for the following:
Our SEO Professional Services team put together an in-depth list of common hreflang mistakes.
Keeping in mind that hreflang is a signal, not a directive, there are other factors to consider that may override your tag and cause a different version of your page to rank higher. Some of these international SEO best practices are:
Even if you do implement any of these international SEO practices, using hreflang tags is a valuable tool for global SEO as it gives search engines a clear signal as to which pages are for users in a specific language or region.
Editor's Note: This post was originally published in June 2016 and has been updated for accuracy and comprehensiveness.