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.
How can you identify that you have an international search results alignment issue like the ones shown above?
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!
SearchCap: The Day In Search, September 17, 2013
Below is what happened in search today, as reported on Search Engine Land and from other places across the Web. From Search Engine Land: Google Patent Search Expands To China, Germany, Canada & WIPO Google announced they have expanded their database of patent documents within Google Patent…
Please visit Search Engine Land for the full article.
Google Trends Adds Trending Charts, 30 Days of Hot Searches
Google Trends has updated the Top Charts to show what’s trending by search volume and compared to normal search volume. You can also now see hot searches for the past 30 days, and the explore page has gotten a bit of a search makeover.
Matt Cutts Talks Google Panda Basics: Make Sure You’ve Got Quality Content
What should you do if you think your site might be affected by Google’s Panda algorithm? And what types of content get impacted negatively by Panda? That is the topic of a recent video featuring Google’s Distinguished Engineer Matt Cutts.
Converged Media in Marketing Starts With Breaking Down Silos
Why do marketers still consider digital and traditional marketing as separate, isolated creatures? Better yet, why is SEO still segregated from social, paid, and display? These were the questions raised by a keynote panel at SES San Francisco 2013.
How to Perform an Opportunity Analysis to Avoid Sloppy Marketing Strategies
“I can’t wait to do some sloppy ass work today.” Nobody says that, right? But we do it. Me included. Most of the time we’re not intentionally sloppy but it happens because we’re either rushing to ‘just ship it’ or we don’t know better. Of all the practices that fall within the discipline of marketing, the […]
Canadian Categories from the New Dashboard Now Added to Google Category Tool
With the help of Darren Shaw of Whitespark, we have recently added the list of Canadian categories from the new Google Places for Business Dashboard to our searchable Google Places Category Tool. The new Places for Business Dashboard is country specific and the categories that one sees are IP & country specific. Thus I need […]
Your Brand Must Stand For Something: Vision and Values in Content Marketing
Yes, content. Right. We talk about it a lot these days. Big content. Starting small. Maturing formats and increased competition. While our work is still “SEO” in the sense that we’re focused on increasing audience and business through organic search, Continue reading »
Google Patent Search Expands To China, Germany, Canada & WIPO
Google announced they have expanded their database of patent documents within Google Patent Search to include patent documents from an additional set of agencies. The new patent agencies included in Google Patent search include China, Germany, Canada, …
Google AdSense Now Supported On HTTPS Web Sites
Google announced that HTTPS sites, SSL secured can now have Google AdSense ads on them without an issue.
For this to work, you simply need to go into your AdSense console…
Google: We Are Not Censoring The Syrian Arab News Agency
The Syrian Arab News Agency doesn’t show up in Google when you search for [Syrian Arab News Agency] but it does come up in Bing when you search for [Syrian Arab News Agency]…
Using Google Analytics With Internet Explorer 8? You Need To Upgrade.
Google announced on the Google Analytics blog that they are officially dropping support for Internet Explorer 8 users…
Google: Don’t Pay The Link Mobster For Link Removals, Just Disavow Them
We have discussed people charging fees to do link removals several times but Google’s John Mueller said you shouldn’t have to pay for your links to be removed – instead just use the disavow tool…
Bing’s New Logo & Search Features Preview
Late last night, Microsoft announced on the search blog the next phase of Bing, Microsoft’s search engine. You can “explore” these changes at bing.com/new.
The most obvious change is the new yellow/orange logo…
New Study Finds Google+ Shares Don’t Cause Higher Search Rankings
Stone Temple Consulting has conducted a study of the impact of Google+ shares on search rankings. The study shows that while Google+ can drive discovery and indexing, there is no measurable evidence that Google +1’s result in higher rankings.
Study Shows No Clear Evidence That Google Plus Drives Ranking
At SMX Advanced, I presented results from a study we had done that convinced me that links in shares from Google Plus and Facebook behave like traditional web-based links. My statements at SMX Advanced were later disputed by Matt Cutts during his keyno…
Live @ SMX East: Trends In Mobile Search
As many pundits predicted, the number of people accessing the internet via mobile devices has exploded. It’s not hope or hype any longer: Industry observers comScore and Nielsen released reports conclusively demonstrating that 2012 was the tipping-point year in which all doubts about the…
Please visit Search Engine Land for the full article.
How Can You Predict A Site’s Future?
I was recently asked how to make sure that each link you build (however you do it) remains a safe one — and I have to say that I truly had no idea how to answer that. A few years back, my answer would have been different than it is today. Remember when we all said […]
Please visit Search Engine Land for the full article.
How to Increase the Profitability of Your Content
Do you have pages that drive conversions but aren’t as prominent as they could be in the site structure or user’s click path? Boost the profitability of your top performing pages by giving them even greater visibility on your site. Here’s how.
