Global expansion, localizing content, and selling in multiple currencies and languages
Hello,
Through vairous apps and website audit tools - i am getting a common theme of Hreflang not being implemented correctly in our website code.
We moved from Glopal at the start of 2023 and went to shopify markets, targeting mainly the USA and France.
Our main domain language is english and domain is co.uk and but our secondary localised language is USA $ on the .com side of our website. We also have a french translated website but this is set to the co.uk/fr.
How should the code be written in the head of the Liquid theme code.
Many thanks in advance for you help and support.
Tim
Hi @TimboH3at5
Hey there, thanks for sharing your issue! I see you're trying to get your hreflang tags set up properly after moving from Glopal to Shopify Markets, especially for your UK, US, and French versions of the site. Getting hreflang right is super important for SEO and localization, so let’s break this down and make sure it's done correctly.
From what you’ve described, your current setup looks like this:
This means your hreflang implementation should clearly indicate the correct language and region variations for search engines to serve the right content to the right users.
In your theme.liquid, you should place this within the <head> section:
{% if request.locale.iso_code == 'en' and request.host contains 'co.uk' %}
<link rel="alternate" hreflang="en-gb" href="https://www.yoursite.co.uk/" />
<link rel="alternate" hreflang="en-us" href="https://www.yoursite.com/" />
<link rel="alternate" hreflang="fr-fr" href="https://www.yoursite.co.uk/fr/" />
{% elsif request.locale.iso_code == 'en' and request.host contains 'com' %}
<link rel="alternate" hreflang="en-gb" href="https://www.yoursite.co.uk/" />
<link rel="alternate" hreflang="en-us" href="https://www.yoursite.com/" />
<link rel="alternate" hreflang="fr-fr" href="https://www.yoursite.co.uk/fr/" />
{% elsif request.locale.iso_code == 'fr' %}
<link rel="alternate" hreflang="en-gb" href="https://www.yoursite.co.uk/" />
<link rel="alternate" hreflang="en-us" href="https://www.yoursite.com/" />
<link rel="alternate" hreflang="fr-fr" href="https://www.yoursite.co.uk/fr/" />
{% endif %}
<!-- Self-referencing tag -->
<link rel="alternate" hreflang="x-default" href="https://www.yoursite.co.uk/" />
1-Each page has a self-referencing hreflang tag – this helps Google avoid confusion.
2-Correct language-region codes:
3-Includes an x-default tag for users who don’t match a specific region, directing them to the UK site by default.
This setup should ensure that search engines properly index and serve the right version of your site to the correct audience.
If you need extra help, just let me know asap. Thanks
Daisy.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025