… on FB Feb 11, 2013
semangat … on FB Feb 11, 2013
Using the Correct Hreflang Tag: A New Generator Tool
Posted by Aleyda
One of the challenges that International SEOs face is correctly targeting the right web presence to the appropriate search audience. Let’s start with a couple of scenarios with these challenges so you can see clearly what I’m talking about.
If I search from a Mexican IP (using a Proxy service, to simulate being in Mexico) in Google Mexico for “comprar zapatos en linea,” which in English means “buy shoes online” I get the following results:
As you can see, Dafiti has a Mexican website version that is ranking no. 1, which is relevant in this case; but also has a Colombian version ranking no. 3 and an Argentinian version ranking no. 7. All of them are using ccTLDs, which should “ideally” give geolocation signals to Google. Additionally, there’s a Spain site ranking no. 2 called Sarenza, also using a ccTLD.
Here’s another example, this time for a couple of branded searches, first only for the brand, “edreams” in this case, which is a popular travel site with a strong international presence and then for “vuelos edreams,” which in English means “edreams flights:”
In the previous image you can see how:
- For its brand name results, despite being searched from Google Mexico with a Mexican IP, the first result is actually the Spain web version and the second is the American one! The Mexican web version—the relevant one for this location—is ranked third.
- For the “vuelos edreams” branded search, the Mexican web page version ranks first (yay!) but the second result shows a webpage that belongs to their Spain site.
The easiest way is to take a look in Google Analytics at which countries your organic search traffic is coming from, by going to the “Audience > Demographics > Location” report (along the appropriate organic search segment) and identifying which landing pages and keywords are bringing those visitors. You can do something similar with the language, with the “Audience > Demographics > Language” report.
You can also verify potential misalignment issues of any website, by checking their top rankings in the different Google international search results (not only your own but any site, which is great if you want to analyze the competition) by using Search Metrics and SEMRush. For example, checking the rankings of the Spain version of eDreams in Google Mexico:
What can we do to prevent those issues? How can we avoid ranking with the incorrect web version in some international search results, or cannibalizing them with many non-relevant Web versions? How can we provide a relevantly targeted web version to the right international audience?
The rel=”alternate” hreflang=”x” annotation came to the rescue, initially released at the end of 2011 and updated in April of this year to support the x-default value. It’s used by Google (and Yandex too) to correctly identify the language and the country targeting of web pages, that can include them as a link element in the HTML head area, in the HTTP header or XML sitemap.
So why can we still see the misalignment issues in international search results, as the ones shown in the previous examples?
From my experience, most of the time Google does a good job in these scenarios when the hreflang annotations are correctly included. You can take a look at:
- The hreflang case study (and success story) that was shared by Saurav, a SEER coworker
- The success story published by Pete from the MediaFlow
- The test developed by Grosen and featured on the State of Search blog
Nonetheless, many sites are still not making use of the hreflang annotations. Some of the issues I’ve seen come from the fact that sometimes we don’t correctly use the hreflang annotations.
Take a look at the number of questions about hreflang in the Moz Q&A Forum and Google’s Internationalization Webmaster Forum; there are still clearly many doubts about how to use it.
One of the error scenarios is the misuse of the hreflang link element by including non-supported values, especially for the region, in the HTML’s <head> area. Google specifies in its official documentation that they support the ISO 639-1 format for the language, and optionally the ISO 3166-1 Alpha 2 format for the region.
Let’s use the web code search engine Nerdy Data to find sites that, instead of including the “en-gb” value to specify that a page is in English targeting the UK (since the ISO 3166-1 Alpha 2 code for the UK is “GB”), are mistakenly including “en-uk”:
Or, as another example, pages that are including “en-eu” to specify they’re in English and targeting to the European Union (the “EU” code in this case is not supported, since regions are limited to countries):
You can see more specifically the case of Hollister—that was shown in both of the previous cases in the Nerdy Data results—how they’re targeting the UK with the “en-uk” value and also, for their general English, German, French, Italian, and Spanish versions targeting to the European Union, they add the “eu” value for the region, which is not supported:
As you can see, although we already have a couple of tools that facilitate the hreflang validation and its inclusion in sitemaps (check out the hreflang validator from DejanSEO and the hreflang sitemap tool from the Media Flow) it would be useful to have another, even simpler tool, that would serve to generate the required hreflang tags according to the languages and countries, thus helping us to avoid the previous issues.
To fill this need, I’ve published the hreflang tags generator tool:
The tool’s goal is to assist you in the generation of the correct hreflang annotations for the different language or country versions of a specific page. You will need to place these in the HTML <head> area of each of its URLs, and that will serve as a reference to generate the rest of the hreflang tags for all of your site pages, with the correct syntax and formats.
When you generate the hreflang annotations the tool allows you to copy/paste the results or download them as a CSV file, so it’s easier to use than other tools, too:
This is only the first version of the tool, and I’m already planning to include more functionality to assist with hreflang annotation generation on a massive scale. If you find any issues with it, or any feedback or ideas, please contact me via Twitter or send me an email at aleydasolis at gmail.
I hope the tool, although very simple, can be helpful to clarify the doubts about how to generate the correct hreflang annotations in your specific case. If you have any questions, please let me know in the comments!
Sign up for The Moz Top 10, a semimonthly mailer updating you on the top ten hottest pieces of SEO news, tips, and rad links uncovered by the Moz team. Think of it as your exclusive digest of stuff you don’t have time to hunt down but want to read!
Continue reading →