When you use hreflang tags as well as canonical tags on your website, you have to be careful not to send confusing signals to Google. Here’s how to implement hreflang tags when you already have a canonical tag solution on your website.
Note: This article was first published on rebelytics.com in 2015 and has since then been updated several times and moved to this blog.
hreflang and canonical tags both have similar functions: They suggest to Google which URLs to index. If you already have a canonical tag solution on your website, which asks Google not to implement certain URLs, and you then add hreflang tags to all of your URLs, you will confuse Google. You will be asking Google to index and not to index certain URLs at the same time.
What do URLs with canonical tags want?
A URL that has a canonical tag pointing to another URL says to Google:
“Hey Google, how’s it going? I don’t want to be indexed. But you can index my twin sister here instead of me?”
A URL that has a canonical tag pointing to itself says to Google:
“Howdy Google, please index me and not my stupid twin brothers.”
Now you have to make sure that your URLs with canonical tags still know what they want after you’ve implemented hreflang on your website:
What do URLs with hreflang want?
A URL with correctly implemented hreflang implementations could say to Google:
“Bonjour Google, comment ça va? I speak French and I want to be indexed. Here are my cousins from other countries. Can you please index them too?”
So URLs with hreflang annotations always want to be indexed and always want additional URLs (their equivalents in other language and country versions) to be indexed along with them.
What do URLs with canonical tags and hreflang annotations want?
Now let’s see what a URL that has a canonical tag pointing to itself and hreflang annotations says to Google:
“Hola Google, ¿qué tal? I am the most mature out of my twin brothers and I want to be indexed. I speak Spanish and these are my cousins from other countries. Can you please index them too?”
This is a very clear and easy to follow instruction for Google. But what if the URL has a canonical tag pointing to another URL and hreflang annotations at the same time?
“Guten Tag Google, wie geht’s? I don’t want to be indexed, please index my twin brother instead. I speak German, so please index me and here are my cousins from other countries. Please index them too.”
And then Google will say:
“What a nutcase! Let’s see what his cousins say.”
And then Google will visit the other URLs in the hreflang annotations and hear a choir of:
“Buon giorno, 今日は, добрый день! We don’t want to be indexed, please index our twin sisters instead of us. But we really want to be indexed, so please? And please, please index all of us because we are all cousins from different countries.”
And then Google will say:
“Shut up! I’m not listening to you and I will just figure out who to index myself.”
If you send confusing signals, Google will ignore your instructions. So make sure your URLs know what they want!
If you are using a canonical tag solution on your website, make sure that URLs that have a canonical tag pointing to another URL do not receive hreflang annotations. hreflang annotations are okay for URLs that point to themselves via canonical tag and for URLs that do not have canonical tags.
Exception: Mobile and AMP URLs
With the announcement of the mobile-first index, Google have changed their recommendations for hreflang on mobile URLs. In the past, it was clear that mobile URLs should have canonical tags pointing to their desktop equivalents and therefore should not receive hreflang annotations. Now, the new recommendation is to add hreflang to the mobile URLs and to the desktop URLs:
Yes, mobile-to-mobile & desktop-to-desktop is our recommendation for hreflang.
— John ☆.o(≧▽≦)o.☆ (@JohnMu) November 29, 2017
As a reader of this blog post, you are probably wondering whether it makes sense to keep the canonical tags pointing from the mobile URLs to their desktop equivalents.
A mobile URL that points to its desktop version via canonical tag and that has hreflang annotations at the same time is clearly sending mixed signals, especially once the mobile-first index is reality.
Let’s see how long Google sticks with the recommendation to have canonical tags pointing from mobile URLs to desktop URLs.
According to this source, the same new recommendation is valid for AMP pages: Canonical tags from AMP versions to desktop versions and hreflang between AMP pages and between desktop pages.