Hreflang implementation - automatically inserted canonical

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:


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:

And the source code is:

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