Skip to main content
Emily Mace
OBAN INTERNATIONAL
Diagnosing issues with Hreflang tags in sitemaps
and on page
@IAmTheLaserHawk @ObanIntl
http://www.slideshare.net/Oban-IDForum
Hreflang tags –
when it all goes
terribly wrong!
2
@IAmTheLaserHawk | obaninternational.com3
Targeting content by country
@IAmTheLaserHawk | obaninternational.com4
You aren’t the only one’s asking
Rand Fishkin
@randfish
@IAmTheLaserHawk | obaninternational.com5
Or finding it hard…
John Mueller
@johnmu
@IAmTheLaserHawk | obaninternational.com6
And we’ve all seen it go wrong…
Your UK site ranks
EVERYWHERE
But….
Your German site
ranks in Norway…
What could possibly go wrong?
7
@IAmTheLaserHawk | obaninternational.com8
So what might go wrong?
There’s really only a
few things to get
wrong
But they can go
wrong quickly…
@IAmTheLaserHawk | obaninternational.com9
Conflicts in your tags
Canonicals must
match
And messages on each
language site must be
the same too
@IAmTheLaserHawk | obaninternational.com10
Return to sender…
URLs must
reciprocally link
for fear of
No Return errors
from Google
@IAmTheLaserHawk | obaninternational.com11
Broken, redirecting, wrong
Links in Hreflang tags
should be live
Avoid redirects on
translated URLS
@IAmTheLaserHawk | obaninternational.com12
Having communication issues
There’s so many ways
this can happen
Incorrect combinations of
languages and countries
and made up codes are
the most common….
@IAmTheLaserHawk | obaninternational.com13
The Star Wars error *
Targeting Austria with
the combination
AT-AT
Austrian being a
language
*It’s the Emily LEGO slide!
@IAmTheLaserHawk | obaninternational.com14
Same, same but different…
Japan has
different language
and country codes
(JA-JP)
So does Sweden
(SV-SE)….
@IAmTheLaserHawk | obaninternational.com15
I’m not sure so I’ll make it up…
I don’t know how to
target my Global
English site
I know: EN-WW
Worldwide is a
country, right?
@IAmTheLaserHawk | obaninternational.com16
The EU issue
@IAmTheLaserHawk | obaninternational.com17
The EU issue
No,
not that one!
@IAmTheLaserHawk | obaninternational.com18
The EU issue
Targeting your EU site in English to
EVERY EU country individually….
@IAmTheLaserHawk | obaninternational.com19
Remember!
Each individual URL can only be targeted
to ONE language and country – multiple
targets for the same page look fake!
@IAmTheLaserHawk | obaninternational.com20
The other EU issue
@IAmTheLaserHawk | obaninternational.com21
Code reminder: on page
<link rel="alternate" href="http://example.com/en-ie"
hreflang="en-ie" />
<link rel="alternate" href="http://example.com/en-ca"
hreflang="en-ca" />
<link rel="alternate" href="http://example.com/en-au"
hreflang="en-au" />
<link rel="alternate" href="http://example.com/en"
hreflang="en" />
@IAmTheLaserHawk | obaninternational.com22
Code reminder: sitemap
<url>
<loc>http://www.example.com/english/
</loc>
<xhtml:link
rel="alternate"
hreflang="de"
href="http://www.example.com/deutsch
/"
/>
<xhtml:link
rel="alternate"
hreflang="de-ch"
href="http://www.example.com/sch
weiz-deutsch/"
/>
@IAmTheLaserHawk | obaninternational.com23
One final place errors occur
The Emily rant:
@IAmTheLaserHawk | obaninternational.com
The Emily rant:
IP SERVING:
JUST SAY NO!!!
24
One final place errors occur
Sitemaps or on
page?
How do I choose?
25
@IAmTheLaserHawk | obaninternational.com26
Simple guideline…
Sitemap
•Ecommerce
•Large sites
•Regularly updated sites
On page •Everyone else
@IAmTheLaserHawk | obaninternational.com27
But this is SEO….
There’s no silver
bullet here…
Consider how your
site set up works
and talk to your
devs
How the hell do I
diagnose the issues
though?
28
@IAmTheLaserHawk | obaninternational.com29
But wait… do I even need to do this?
Google says
it fixes things
for me, so
why bother?
@IAmTheLaserHawk | obaninternational.com30
Where are issues occurring?
Use ranking information to see which
site is competing against which
is awesome for this
@IAmTheLaserHawk | obaninternational.com31
Check domains in each country
@IAmTheLaserHawk | obaninternational.com32
Where are issues occurring?
Traffic from the wrong country in Analytics
@IAmTheLaserHawk | obaninternational.com33
Let’s spot check code
Sense check those
language and country
codes – ensure there’s no
made up combinations…
Make sure the self
referencing link is there too
@IAmTheLaserHawk | obaninternational.com34
Let’s spot check code, again…
Does the link agree with
the canonical tag?
Are the Hreflang tags in
the right place?
@IAmTheLaserHawk | obaninternational.com35
Let’s spot check our sitemap
Does every page have
Hreflang tags
In all sitemaps
Including self referencing tag?
Check all the same elements
here too
@IAmTheLaserHawk | obaninternational.com36
Sitemap 101 – the refresh
I don’t need to say this but….
Live pages? No redirects?
Nothing blocked by
robots.txt
You know the drill…
@IAmTheLaserHawk | obaninternational.com37
What do your tools show?
Errors from Google
Search Console
Download data…we’ll
need it later…
@IAmTheLaserHawk | obaninternational.com38
Don’t forget Screaming Frog…
Easily pull off data
about missing, non
canonical, incorrect
language codes etc…
Missing Non
Canonical
Wrong
Country
@IAmTheLaserHawk | obaninternational.com39
We’re SEOs – let’s Excel!!!
Because data
Vlookup or Match are
your friends, cross
checking what works
and what doesn’t…
@IAmTheLaserHawk | obaninternational.com40
Setting up your Excel playground
Crawl all the sites and set up a tab for each
crawl – copy internal All for each site here
Download Hreflang tag tab from Screaming
Frog and create a new tag for the hreflangs
for each country
Add data from GSC and
Hreflang tag errors in SF
@IAmTheLaserHawk | obaninternational.com41
Excel playground fun
@IAmTheLaserHawk | obaninternational.com42
Let data comparison commence
Check to see if all pages have a Hreflang
tag – highlight what’s missing
Are all Hreflang tags the same?
Highlight what’s different
@IAmTheLaserHawk | obaninternational.com43
Correcting issues
Easiest fix is one which gets your devs on
board
We find simple code examples work best
Take our your datacrunching…
Just show the result!
@IAmTheLaserHawk | obaninternational.com44
Simple mapping
If you are ecommerce, mapping can be
simple – URLs with SKUs in are your
friend
@IAmTheLaserHawk | obaninternational.com45
Less simple mapping
Sadly, it’s manual!
@IAmTheLaserHawk | obaninternational.com46
Get it right for great things
Thanks!
@IAmTheLaserHawk
47