Hreflang implementation - automatically inserted canonical

michalc524
New Member
3 0 1

Hello shopify community,

I am writing about the implementation of the hreflang and the correct indexing of three identical websites in German for the DACH region - for Germany, Austria and Switzerland. Websites use masked redirects, and the content is loaded from the same server on three domains, so the content is 100% identical. Therefore, it is not possible to use apps from the shopify App Store - none of them count with this. We want to implement Hreflang with following liquid code:

 

 

<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.tukataka.de' }}" hreflang="de-de" />
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.tukataka.at' }}" hreflang="de-at" />
<link rel="alternate" href="{{ canonical_url | replace: shop.domain, 'www.tukataka.ch' }}" hreflang="de-ch" />

 

 

 

The code works like this, generating three hreflang attributes with the correct domain for each subpage. The problem is that Shopify automatically adds rel = canonical after these hreflang tags, making them inoperable because it defines one main domain that has a higher priority in indexing than language mutations. Rel = canonical is not in the template source code, it is loading in the background and I can't cancel it. Theme.scss looks like this:

hreflang in theme.scsshreflang in theme.scss

 

And the source code is:

hreflang in source codehreflang in source code

So Shopify automatically adds rel = canonical and there hreflang doesn't work because of that.

Can you please help me what to do with it? How to remove automatically added rel = canonical? Thank you

 

Best regards,

Michal

Replies 0 (0)