How can I fix the 'No self-referencing hreflang' SEO error on my pages?

Hi All Shopify Guru’s :-),

I have had an SEO report done and it is returning a report that 100’s of pages have the following error:

“No self-referencing hreflang”. I am using the Impluse theme and have spent lots of time looking online to find a fix but cannot find one. I am hoping that someone knows how to fix this one?

Thanks

Hello @coffeemand

The error “No self-referencing hreflang” means that the page does not have a hreflang tag that points to itself. This is important for SEO because it helps Google understand that the page is available in multiple languages.

To fix this error in the Impulse theme, you can add the following code to the theme.liquid file:

{% for language in languages %} {% endfor %}

This code will add a hreflang tag for each language that is supported by your store. The hreflang tag will point to the same page, but with the language code in the URL.

For example, if you have a page that is available in English and French, the hreflang tag for the English version of the page would be:

<link rel="alternate" hreflang="en" href="https://example.com/en/my-page" />

The hreflang tag for the French version of the page would be:

<link rel="alternate" hreflang="fr" href="https://example.com/fr/my-page" />

By adding these hreflang tags to your pages, you can help Google understand that your pages are available in multiple languages and improve your SEO.

Thank you for the reply. Does it matter where in the code I put this. Also, I am getting the error for over 700 pages. Do I need to add this for each page ?

<link rel="alternate" hreflang="en" href="https://example.com/en/my-page" />

We automatically add hreflang tags for every market you sell into. This warning is over zealous (we have consulted with SEO experts internally) and is not something you should be concerned with. As I mentioned, for every country/market that you sell into, we create a hreflang tag for you to tell Google and other search engines that it is a regional version of the same page.

1 Like

I am facing the “No self-referencing hreflang” issue with my shopify website but the catch is that the main blogs and products pages have correct “hreflang tag” is implemented but “Semrush” showing this issue with extra parametrs in the slugs (eg: www.abcd.com?_pos=5&_sid=a8ea0e87b&_ss=r

www.abcd.com?utm_source=Klaviyo&utm_medium=campaign&utm_campaign=intermittent fasting w/e EDM&utm_id=01GV4QWHJW4FRY2B5KPW4KTK33&_kx=ry_cT-eiyoWEZIzka6VPRakMeMeRy2ILXq_Bnhq1iSQzuZeu3svTng2vSmRIS5x-.RrK8SG)

My question is how can i resolve this isse?