Why The F*$%
Doesn't This
HREFLANG Work?
Sophie Gibson | Rise at Seven
SLIDESHARE.NET/SOPHIEGIBSON3
@SophieGibson
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Hi, I'm Sophie
Technical SEO  Rise at Seven
@sophiegibson
@riseatseven
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Helps Google understand the
relationship between the same
content in alternate languages
and/or regions
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG
Image via Sam Underwood: https://www.samunderwood.co.uk/resources/visualising-seo/
TSHIRT FOR A
UK AUDIENCE
SAME TSHIRT FOR
A US AUDIENCE
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Improve search
visibility
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Users more likely to
convert
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Reduces duplicate
content problems
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
How does
HREFLANG
get on a site?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THREE WAYS TO IMPLEMENT
1 HTML tags
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THREE WAYS TO IMPLEMENT
1 HTML tags
<link rel="alternate" href="https://www.example.com/"
hreflang="en" />
<link rel="alternate" href="https://www.example.com/en-gb/"
hreflang="en-gb" />
<link rel="alternate" href="https://www.example.com/en-us/"
hreflang="en-us" />
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THREE WAYS TO IMPLEMENT
1 HTML tags
2 HTTP headers
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Link: <http://example.com/file.pdf>;
rel="alternate"; hreflang="en",
<http://de-ch.example.com/file.pdf>;
rel="alternate"; hreflang="de-ch",
<http://de.example.com/file.pdf>;
rel="alternate"; hreflang="de"
2 HTTP headers
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THREE WAYS TO IMPLEMENT
1 HTML tag
2 HTTP headers
3 In an XML sitemap
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
3 In an XML sitemap
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>http://www.example.com/english/page.html</loc>
<xhtml:link rel="alternate" hreflang="de"
href="http://www.example.com/deutsch/page.html"/>
<xhtml:link rel="alternate" hreflang="de-ch"
href="http://www.example.com/schweiz-deutsch/page.html"/>
<xhtml:link rel="alternate" hreflang="en"
href="http://www.example.com/english/page.html"/>
</url>
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
What does
HREFLANG
need to work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG NEEDS TWO THINGS
1 Valid hreflang attributes
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG
Image via Aleyda Solis: Avoiding hreflang issues by following a 6 step implementation process
VALID HREFLANG ATTRIBUTES
REQUIRED
OPTIONAL
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG NEEDS TWO THINGS
1 Valid hreflang attributes
2 Return hreflang tags on all
alternate page versions
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
RETURN TAGS ON ALL VERSIONS
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG THEORY
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG REALITY
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Dev
resource
Size of site
/ country
versions
CMS
platform /
Site set-up
x x
DIFFICULTY COMPOUNDS
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Why the F*#&
doesn't this
HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT!
for
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT FOR
Mix of alternate version landing
pages ranking for terms in
another location
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT FOR
Content not being indexed in
alternative languages and
locations
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT FOR
Google classing alternative
site page versions as a
canonical of the other pages
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
COVERING
Why HREFLANG is not
having an effect when it's
on the site
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
LOOKING AT
- Common problems with HREFLANG
- Why they're an issue
- How to fix
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HOW?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SCENARIO
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SCENARIO
How the issue was found
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SCENARIO
How the issue was found
Troubleshooting the problem
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SCENARIO
How the issue was found
Troubleshooting the problem
How it was resolved
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SCENARIO
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SCENARIO
ECommerce site targeting UK 
two other countries
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
IMPLEMENTATION
HREFLANG in the <head>
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WHAT WAS THE PROBLEM?
Non-UK landing pages were
ranking for keywords in the UK 
instead of the UK site
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
Checked GSC
International
targeting report
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
Checked GSC
International
targeting report
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
IMPLEMENTATION
It looked all correct…
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
IMPLEMENTATION
It looked all correct…
It was on the page…
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
IMPLEMENTATION
It looked all correct…
It was on the page…
It validated in tools…
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
ME BUT IT'S THERE?!
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
GOOGLE NOT THERE…MIRAGE
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
So,why the F*#&
doesn't this
HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
If it's there - why can't Google
see it properly?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
???
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
Checked the page via the W3
validator
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
https://validator.w3.org/
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
https://validator.w3.org/
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT!
for
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE ISSUE
<noscript> tag with an img
element in the <head>
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
<body> only <body> or <head>
can only contain <link>
<style> and <meta> tags
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
???
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE CULPRIT
3rd party tracking scripts
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE CULPRIT
3rd party tracking scripts
Looking at you,Facebook
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{your-pixel-id-goes-here}');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id={your-pixel-id-goes-here}&ev=PageView&
noscript=1"/>
</noscript>
<!-- End Facebook Pixel Code -->
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{your-pixel-id-goes-here}');
fbq('track', 'PageView');
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id={your-pixel-id-goes-here}&ev=PageView&
noscript=1"/>
</noscript>
<!-- End Facebook Pixel Code -->
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
<noscript>
<img height="1" width="1"
style="display:none"
src="https://www.facebook.com/tr?id={yo
ur-pixel-id-goes-here}&ev=PageView&
noscript=1"/>
</noscript>
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
SOLUTION
Move <noscript> to body
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
https://validator.w3.org/
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
https://validator.w3.org/
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG REALITY
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WHAT ACTUALLY HAPPENED
Non-UK landing pages were
still ranking for keywords in
the UK
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT!
for
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
So,why the F*#&
doesn't this
HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
Checked the page via Sitebulb
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE ISSUE
Single Point of Failure
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Steve Souders - Frontend SPOF | High Performance Web Sites
WHAT HAPPENS IN THE BROWSER?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE ISSUE
3rd party scripts in the
<head>
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE ISSUE
3rd party scripts
in the <head>
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HOW TO FIX
Move the HREFLANG markup
above the scripts
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
FURTHER READING
Oliver
Mason
Breaking the Head (Quietly)
https://ohgm.co.uk/breaking-head-quietly/
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG REALITY
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WHAT ACTUALLY HAPPENED
Non-UK landing pages were
still ranking for keywords in
the UK
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
So,why the F*#&
doesn't this
HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
Page HTML was okay?
Scripts moved?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
TROUBLESHOOTING
If you visited the .com site it
redirects you to a subdirectory
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
THE BIGGER
ISSUE
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
GEOLOCATION
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Geotargeting isn't an exact
science,so it's important
to consider users who land
on the "wrong" version of
your site
- Google Search Central - Managing Multi Regional Sites
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WHY DOES THIS HAPPEN?
Geolocation based redirects
takes Google to one version
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
ROADBLOCK
Googlebot gets redirected to the
/us/ version of the site
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Consider users who land
on the "wrong" version of
your site
- Google Search Central - Managing Multi Regional Sites
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
COUNTRY
SELECTORS
Users have
options - did bots?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WHY DOES THIS HAPPEN?
Country switchers with me
Deliver search-friendly JavaScript-powered websites (Google I/O '18
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WHY DOES THIS HAPPEN?
Google can’t find any crawlable
internal links to alternate
country versions of the page
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HOW TO FIX IT
Adding a href tag & anchor text
to create an internal link to
alternate page versions
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
DEVELOPMENT RESOURCE
What if you don’t have much?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
OTHER OPTIONS
Set it up in the sitemap instead
via Magento plugin
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
OTHER OPTIONS
This wasn’t an option due to
the site set up,this didn't
work
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
IN SUMMARY
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG ISSUES CAN CASCADE
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
…IT'S PROBABLY
THE HEAD
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
HREFLANG is just
one aspect of
international SEO
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Image via Onely
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
WATCH OUT!
for
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
Thanks!
@sophiegibson
@riseatseven
Questions? Reach me on Twitter
@sophiegibson #brightonSEO Why the F*#& doesn't this HREFLANG work?
RESOURCES
Aleyda Solis: Hreflang Implementation Guide
Analytics Mania: How to Fix Facebook Pixel Code <noscript> in GTM
OHGM Breaking the <head> (Quietly)
OHGM Hreflang Tags Not Respected (How to Solve)
Onely: Ultimate Guide to International SEO
Sitebulb: <head> contains a <noscript> tag, which includes an image
Sitebulb: Contains one or more single point of failure

Why the f*ck Doesn't This HREFLANG Work - BrightonSEO Autumn 2021