Digital Marketing

How to Implement Hreflang Tags

Abstract Background Of Spheres And Lines

Full Transcript

Today I am going to explain how to implement Hreflang tags, and when you should use them.

What Are Hreflang Tags Used For?

Hreflang tags are useful when you have different versions of your website targeted either for different languages or different countries. The simplest use case is when you have translated versions of your site for different countries. Perhaps something like this:

  • English language site for the US
  • German language site for Germany
  • Spanish language site for Spain
  • And so forth

However, the world is much more complex than that. The same language can be used in more than one country, and hence your situation might be more like this:

  • English language site for the US
  • English language site for Canada
  • English language site for the UK
  • English language site for Australia
  • Use the US version of the site for the rest of the world

As if that was not bad enough, there are other scenarios to worry about too. For example:

  • German language site for Germany
  • German language site for Austria
  • German language site for Switzerland
  • Italian language site for Switzerland
  • Italian language site for Italy
  • French language site for Switzerland
  • French language site for France

This quickly gets very complex! As you can imagine, it’s also very complex for Google too. Wouldn’t it be cool if there was a tag that you could put on your pages to make sure Google uses your sites the way you want them too? Fear not, there is, and it’s called the Hreflang tag.

How to Implement Hreflang Tags

  1. Start by identifying which versions of your site you want to map to which countries.
  2. Assemble that in a spreadsheet.
  3. Note that you can either specify a language and a country, or a language only, but not a country only.
  4. Use x-default if you use IP redirects or if users hand select languages on your site.
  5. Place the tags on your site using the format shown in the image below.image The first 3 lines show combined language-country tags, and the 4th one is an example of a language only tag.
  6. Place the complete set of tags for all of your sites on all of the pages of all the sites. This is important as it is the behavior that Google is looking for. In short, if Page A has a tag pointing to Page B, then Page B must have a tag pointing back to Page A.

But Wait, There’s More!

You should use Hreflang tags on all the pages of your sites that you want indexed, but shouldn’t put them on other pages you don’t want indexed. As a result, you don’t need to put them on pages that implement rel=canonical tags that point to other pages.

In the above description, I described this based on the assumption that you would put the hreflang tags as markup in the section of your web site, but there are other options. Here they are:

  1. Put them in the head section of your page as a link attribute (this is the mode I discussed above.)
  2. Have your web server communicate these in the page’s HTTP protocol header.
  3. Specify them in a sitemap – lists all variants, as long as each listed site is verified in Search Console.

Only specify Hreflang by one of these 3 methods. Putting it in multiple places carries too much risk that you will forget to update 1 of them, and that would not be good, as providing the search engines with conflicting instructions is a bad idea.

Also, be careful to specify the language in ISO 639-1 format, and the region in ISO 3166-1 Alpha 2 format, as these are what Google is using for that.

For more information, please refer to Maile Ohye’s excellent video on the topic, which you can find here, or our interview with Google’s Gary Illyes: What is the hreflang tag and how does Google use it?

Also, here are three tools that can help you with generating/checking hreflag tags:

  1. Hreflang Builder from Bill Hunt
  2. Hreflang Builder from Aleyda Solis
  3. Hreflang Testing Tool from Bill Hunt

More of Digital Marketing Classroom

For other tutorials in this series see: Digital Marketing Classroom.

Thoughts on “How to Implement Hreflang Tags”

  1. The href lang implementation on website has been a great challenge and i have alot of visits from french speaking countries on
    But with this points, I can give it a try.

  2. Wow! Thanks guys for this info, I now have a clue of how to go about href Lang issues when next I encounter them on my client sites.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Eric Enge

Eric Enge is part of the Digital Marketing practice at Perficient. He designs studies and produces industry-related research to help prove, debunk, or evolve assumptions about digital marketing practices and their value. Eric is a writer, blogger, researcher, teacher, and keynote speaker and panelist at major industry conferences. Partnering with several other experts, Eric served as the lead author of The Art of SEO.

More from this Author

Subscribe to the Weekly Blog Digest:

Sign Up
Follow Us