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: https://help.shopify.com/en/themes/development/theme-store-requirements/internationalizing/using-hre... 

 

<link rel="alternate" href="https://ourexampleshop.com" hreflang="en" />
<link rel="alternate" href="https://ourexampleshop.com
" hreflang="en-se" />
<link rel="alternate" href="https://ourexampleshop.com" hreflang="en-no" />
<link rel="alternate" href="https://ourexampleshop.com" 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!

0 Likes
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, 'your-domain.com' }}" />
<link rel="alternate" hreflang="en-se" href="{{ canonical_url | replace: shop.domain, 'your-domain.com' }}" />
etc.

0 Likes