English Español Deutsch Français Italiano Português (Brasil) Русский 中文 日本語
Submit post
Go to Blog

The Ultimate Hreflang Guide for Dummies

Martin Kura
The Ultimate Hreflang Guide for Dummies

With Google coming out with its new international targeting feature, I’ve seen more poorly implemented Hreflang annotations than good ones.

These 5 easy steps will help you avoid mishaps and implement Hreflang tags correctly across your multilingual website.

Do I Need Hreflang?

First of all, Hreflang should NOT be used simply to indicate the language of the page: it has other well-established methods of doing that. Hreflang tells Google that different language or country versions of the same page are related, so it can serve the right content to the right users worldwide.

Here are the most common examples of when it’s good to use Hreflang:


Have you found similarities with your global website? Great, let’s rock’n’roll.

Why Should I Care About Language vs. Country Targeting

Language targeting is useful when you want to approach users speaking the same language in different countries. For example, users who travel a lot or field specialists who are used to reading in foreign languages or same-language countries.

On the contrary, targeting users in a particular country is usually more precise and efficient than targeting users by their language.

So – Let the fun begin!

STEP 1: List the URLs of Your Multilingual Website

To ease things up, I’ll show you how to handle language targeting first. In a new spreadsheet, create a table with headers corresponding to your website’s language versions. Add an extra column and name it “Hreflang.”

When you sort your website URLs like this, you’ll then see which pages have equivalents in different languages. Non-equivalent, standalone URLs don’t need to be hreflang-ed.

sort your website URLs

So far, so good.

STEP 2: Make a Hreflang Set Out of 1 Row

Let’s say we’ll try to create a Hreflang tag for the page: www.mysite.com/page2.html targeted at English-speaking users.

This is what an example Hreflang tag looks like:

<link rel="alternate" hreflang="es" href="http://es.example.cz/" />

We’ll simply replace the example language code with the code we want from this list. So “en” for English in this case. We’ll also replace the sample URL with our desired English URL:


That wasn’t so bad, was it? Now, let’s do the same for all the remaining equivalents we have in the table:


For the German version:

<link rel="alternate" hreflang="de" href="www.mysite.com/de/seite2.html" />

For the Spanish version:

<link rel="alternate" hreflang="es" href="www.mysite.com/es/pagina2.html" />

Easy, right? So let’s piece them all together:

<link rel="alternate" hreflang="en" href="www.mysite.com/page2.html" />

<link rel="alternate" hreflang="de" href="www.mysite.com/de/seite2.html" />

<link rel="alternate" hreflang="es" href="www.mysite.com/es/pagina2.html" />

Now, place the Hreflang tags into the empty “Hreflang” column in the respective cell. Like this:

Hreflang tags into the empty Hreflang column

STEP 3: Keep Going

Repeat the same process for the remaining rows until all are filled in. Row 2, Hreflang tags, Row 3, Hreflang tags ...

STEP 4: Put It On Your Website

Once you’ve done the entire Hreflang column, it’s time to implement Hreflang on your website. It’s going to be very easy now, because you’ve done the tricky part and now it’s just copy-paste.

The fun part is that you copy-paste exactly the same Hreflang tag on every page in the row.

Between the <head> and </head> tags.

STEP 5: Test What You’ve Done

Log in to your Google Webmaster Tools account and go to Search Traffic > International Targeting. If you set up your Hreflang tags correctly, you should be able to test them using this built-in feature.

The results could look like this:

International Targeting

Image credit and more info: http://googlewebmastercentral.blogspot.cz/2014/07/troubleshooting-hreflang-annotations-in.html

If you can’t see any numbers or figures, don’t worry. Go back to Webmaster Tools in a couple of days. If you still don’t see anything, you may have to check the following:

  1. Are you using the correct piece of code I gave you? No? (Naughty, naughty...)
  2. Have you put the code in the header (between <head> and </head>)? If you have no idea what the heck I am talking about, talk to your webmaster.
  3. Have you used the correct language or country code? Check the links above again.
  4. Is there a quotation mark missing?
  5. Is there an extra space around the language/country code?
  6. Have you not swapped the language and country codes? (language first, hyphen, country)
  7. Have you not confused a dash and a hyphen? (this is a hyphen: -)

When You’re Targeting Users in a Particular Country

If you want to approach users in a certain location, country targeting is definitely a better fit for you. The only difference to language targeting is that you specify the location in the table headers:

specify the location in the table

… and add a country code from this list after a hyphen. Like this green one:

link rel="alternate" hreflang="de-de" href

The rest is the same. It’s also perfectly fine to combine language and country targeting. One language version may be targeting German speaking users, while the other, users in Spain.

IMPORTANT: Never ever confuse language codes and country codes. They are different. For example “be” is a country code for Belgium, but a language code for Belarusian. Also don’t try to figure out the country code yourself: “uk” is not a country code for the UK, but for Ukraine.

Have you managed to implement Hreflang annotations on your website? Let me know in the comments!

Martin Kura

Provides valuable insights and adds depth to the conversation.

Martin Kůra is an International SEO Strategist. You can visit his personal website.
Share this post



Either just recently joined or is too shy to say something.

Hello Martin,

Nice info but still i have a question or you can doubt my site url is [link removed by moderator] , basically the content is written in english but if use any wp plugin like google translator , can i use herflang in my site to target all countries , languages which are translatable in google translator.

Used url to show the site for better understanding


Either just recently joined or is too shy to say something.

Hello Martin, thanks for a great article!
I got .co.uk as a default ecommerce site and plan to expand to other english speaking countries, so domain names will be .ca, .com and etc. under one backend. Do I have to add href to default store as well? And also, CMS pages will have different URLs, but products will have the same global link (naughty Magento) although content will be slightly different. Do you have any suggestions how could I add href in such case? Thanks a lot!
Martin Kura

Provides valuable insights and adds depth to the conversation.

Hello Monsoon, if you decide to use hreflang, it should be implemented across all equivalent versions, i.e. on the default store as well. If products have the same URL, there is no need to implement hreflang, as there are no equivalent URLs as such. Only if you plan to apply a different product strategy in different regions, I recommend adapting the Magento store to display products under regional URLs, or using another CMS that can do that in its native version (WordPress, Drupal, OpenCart etc.). Have a great day!

Either just recently joined or is too shy to say something.

Hello Martin, how about this: I have only one page, but the same page has a paragraph in English, then the identical paragraph in Spanish. It is a site about learn Spanish,so I need those two languages into the page's body. Google and other search engines are getting crazy, even the translation tools as bing translator and google translator too. Do you have any suggestion? Thank you. The main site is written in English, modules, footer, template...
Martin Kura

Provides valuable insights and adds depth to the conversation.

Good question, mexivan. How about using iframes or images for the Spanish content? Also, other geo-targeting signals play a role, like what TLD you use, if you have local backlinks etc. So, if the rest of the geo-signals is sorted, you should be fine even with Spanish content on an English site.

Either just recently joined or is too shy to say something.

Martin, great guide... I like the last section where you clarify the country-specific targetting vs just language, and the confusing scenarios your mention. Like everything, the challenge arrives when starting to plan for enterprise implementations. Your post would be brilliantly complemented with a spreadsheet template including sections of the site, eg: each category in the topnav onto a different tab in the spreadsheet, etc.... anything to try and make the thousands of lines more readable could be welcome. But maybe that's another post ; ) cheers again
Martin Kura

Provides valuable insights and adds depth to the conversation.

That's a great point, David! A spreadsheet template would certainly ease things up here. I was actually seriously considering creating a template that also can generate the hreflang tags in each row, but got lost in formulas, eventually. Hopefully I can make it to the next post! Any Excel wisdom or help is welcome ;)
Muhammad Kamran

Either just recently joined or is too shy to say something.

Nice Write up Martin. We have implemented hreflang tags on our site English and Spanish versions, it works very well. English Version :http://excite.com/events/ and the Spanish version : http://excite.com/events/es
Martin Kura

Provides valuable insights and adds depth to the conversation.

Muhammad Kamran
Great, Muhammad, I'm glad you like it! Regarding your sites, I recommend changing the structure to http://excite.com/es/eventos. The reasons for this is that a user can retain his/her chosen interface language even when going higher in the structure (doesn't have to switch between languages too often) + a Spanish keyword in URL will help as well. Good luck!

Send feedback

Your feedback must contain at least 3 words (10 characters).

We will only use this email to respond to you on your feedback. Privacy Policy

Thank you for your feedback!