Hreflang setup - how to remove hreflang canonical?

Topic summary

Core Issue:
Shopify automatically generates unwanted hreflang canonical tags when custom hreflang tags are added to theme.liquid, even though these auto-generated tags don’t appear in the theme code itself.

Context:
The original poster manages three Shopify stores (tukataka.de, .at, .ch) for the DACH region using masked redirects from a single server. They successfully implemented custom hreflang tags via Liquid code but encountered automatic canonical tag generation pointing to the homepage.

Proposed Solutions:

  • Shopify Markets: One user suggested deactivating Shopify Markets, which auto-generates hreflang tags and causes conflicts
  • Sitemap Implementation: The most successful approach involved adding hreflang tags directly to XML sitemaps rather than theme files. This requires downloading Shopify’s native sitemap, manually adding hreflang tags (or using Screaming Frog), uploading to Shopify Files, and submitting to Google Search Console. Updates needed every 1-4 months depending on site size
  • Contact Shopify Support: Shopify can disable automatic hreflang/canonical generation, giving full control over custom implementation
  • Theme Placement: Some users reported success placing code inside (not before) the <head> section

Status:
The discussion remains open with multiple workarounds shared but no universal solution for all Shopify configurations.

Summarized with AI on October 26. AI used: claude-sonnet-4-5-20250929.

Hello there,

We are currently doing SEO optimization of our shopify stores selling learning towers. As part of SEO, we want to deploy hreflang. The interesting thing about our shops is that we sell in the DACH region - Germany, Switzerland, and Austria, and the shops are actually one shop with masked redirects loaded on multiple domains from one server. So if I make a change to one shop, I make it automatically to everyone else. URL adresses of the stores are www.tukataka.de, www.tukataka.at and www.tukataka.ch.

We have already solved how to add hreflang for all domains. It is possible with help of this Liquid code and inserting it in theme.liquid before /head tag:


Or with this one (a bit simpler):


Both are fine.

The problem is that if I insert this code into theme.liquid before /head tag, Shopify automatically adds hreflang canonical tag pointing to homepage:

Hreflang is not in theme.liquid, but it somehow appears in website code:

The canonical hreflang tag appears immediatelly after adding any hreflang alternate tag. The canonical tag appears automatically after adding any hreflang alternate. And its not in theme.liquid code. Therefore, I believe probably Shopify adds it automatically on the background.

Thus, my question is how to remove the hreflang canonical tag? Any ideas? Thanks.

Best regards,

Michal

1 Like

Same problem! It should be the solution to turn off shopify automatic generated hreflangs tags

1 Like

Find solution! shopify Markets make a mess with hreflang. Deactivate and it will be gone duplicated hreflang @michalc524

1 Like

Same problem. Shopify markets should have option to turn off auto hreflang generating!

Hi @DariusWS

Can you explain further what do you mean?

I have the same problem.

Thanks

We dont use Shopify Markets, intead we have 2 separate stores. Shopify auto-generates hreflang tags even in this case. :confused:

Maybe that will help:

That is what the liquid code below does:

<link rel="alternate" hreflang="x-default" href="{{ canonical_url | replace: shop.domain, 'www.mystore.com' }}" />
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.mystore.com' }}" hreflang="en-GB" />
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.us.mystore.com' }}" hreflang="en-US" />

This code snippet can be added into the section of your theme.liquid file. You need to replace the ‘mystore.com’ instances with your actual domain names. When this snippet is in place, your pages will output hreflang tags using the page canonical to construct the URL path.

Source:

https://eastsideco.com/blog/everything-you-need-know-about-hreflang-and-shopify

Hi, we already tested this code and it doesnt work. Please first read the problem in post n. 1 - before posting spammy links.

Hi @michalc524 ,

My apologies, I see the last paragraph I wrote is somehow not appear in my last message and that led to this confusion of me not seeing the first solution you tried.

After trying all methods I found on the internet, I placed it in the section of my site theme.liquid (not before like you did) and I think it’s working well, Shopify isn’t automatically adds hreflang canonical tag pointing to homepage.

If I missed something let me know, I also tried to learn if maybe I missed something.

Thanks

Good for you, unfortunately for the two shops i manage the situation is different.

But we already found a solution: add hreflang tags to sitemap :slightly_smiling_face:

Hi @michalc524 ,

Interesting, can you share how did you add hreflang tags to sitemap?

Hi, I used standard sitemap + hreflang guide, for example: https://searchengineland.com/how-to-implement-the-hreflang-element-using-xml-sitemaps-123030

But I dont use the native Shopify sitemap, because it cant be edited. Instead I download the sitemap every 2 Months and add the hreflang tags there. And then I update it manually in Search console.

What do you think about this solution? Any tips to make it better? :slightly_smiling_face:

Hi @michalc524 ,

Apparently my solution is not working anymore, again Google Search is showing searches in English, although the primary language is Dutch as you can see (from theme.liquid - inside the head section):


	
	

So I’m trying your solution.

By “update it manually in Search console” do you mean that you manually add all the links one by one to the search.google.com sitemap?

I also tried to follow the example from the given link you shared but got an error when I tried to upload it

Can you give an example and show step by step how to add?

Thanks

Hi @michalc524 ,

I think I understood your solution better, I only don’t understand the last part.

How do you update it manually in Search console?

Best,

Ben

Hi Ben @Ben1000

Shopify generates its own sitemap: store.url/sitemap.xml. You dont have to upload this sitemap to Search Console. Insted you can download this sitemap and add hreflang tags into it. Or you can generate it via CrazyFrog. And then upload this sitemap with hreflang tags to Shopify files and add the files URL to Search console. And do this for all shops. You can update the file every 1 month, or 2-4 months, depending on the shop size and SEO priority.

The shop I mentioned in my first post uses masked cloaking - the same website is loaded on three domains - for Germany, Austria, aund Switzerland. (We modify the content with GTM.) The process is similar, but the shop had to generate 3 sitemaps, upload them to the same Files section, and then add to three GSC account.

EDIT: Or you can you an app. App is the simplest solution. But in your case we couldnt use app because of the masked cloaking.

Hope this helps,

Michal

1 Like

Hi @michalc524 ,

Thanks for your advice. Did you mean Screaming Frog?

Besides, I tried an app in the past, and it didn’t work well for me. If my website is with the same domain:

  • webstore.nl
  • webstore.nl/en

Can I do the same thing via Screaming Frog or should I proceed with another option?

Thanks

Hi @Ben1000

Yes, exactly, I meant Screaming Frog and yes, you can use Hreflang Sitemap Tags even for content in different languages on the same website. You should contant a SEO expert and discuss with him, how to add the hreflang tags into a sitemap, and of course he should check if the setup is ok.

Eventually you can find in Ahrefs if some page has active Hreflang language variations and check it there too. But the key move is to contact a SEO expert.

Best regards

Michal

1 Like

Hi @michalc524 ,

Thank you so much for your help. I see Screaming Frog let using hreflang only for paying customers. I hope to find a free tool, if not I will use Screaming Frog and contact SEO expert

Thanks!

How to Manage or Remove These Tags

  1. Contact Shopify Support

    • Shopify can disable the automatic generation of hreflang and canonical tags. Once disabled, you’ll have complete control and can implement your own tags in your theme Shopify Help Center.
  2. Manually Add Custom hreflang and Canonical Tags

    • Edit your theme’s theme.liquid or appropriate template files—within the <head> section—to insert custom hreflang and canonical tags.

    • Make sure to:

      • Use self-referencing canonical tags (each page points to itself).

      • Add bidirectional hreflang tags (A points to B and B back to A).

      • Use absolute URLs, valid ISO language-region codes, and include an x-default fallback