Question about hreflang implementation

New Member
4 0 0

Hi ShopifyCommunity!


We've four stores across different sub-domains targeted at specific countries within Scandinavia, and one targeted for global users. These websites have the same content (English) and in order to avoid duplicate content issues and to make the searchers' experience better I'm thinking about implementing hreflang tags. I believe I've the code that I need, which is based on this explanation: 


<link rel="alternate" href="" hreflang="en" />
<link rel="alternate" href="
" hreflang="en-se" />
<link rel="alternate" href="" hreflang="en-no" />
<link rel="alternate" href="" hreflang="en-no" />


Now, my question is wether I need to implement this code on each page in all stores, or just in the <head> section of each store's theme.liquid?


Thank you in advance!

New Member
1 0 0

Hey there,

you only need to enter this in the <head> of your theme.liquid.

You should also look in to structuring the hreflang like:

<link rel="alternate" hreflang="en" href="{{ canonical_url | replace: shop.domain, '' }}" />
<link rel="alternate" hreflang="en-se" href="{{ canonical_url | replace: shop.domain, '' }}" />