How can I resolve href lang issues with Impulse theme?

Topic summary

A Shopify store owner using the Impulse theme is encountering hreflang and canonical tag issues flagged by SEMrush site audit.

Core Problem:

  • Product URLs include collection names (formatted as product.url | within: collection)
  • This creates multiple URLs for the same product, triggering duplicate content warnings
  • The hreflang tags are auto-generated by the theme with no editing section available

Attempted Solution:

  • User tried adding a custom canonical tag: <link rel="canonical" href="{{ canonical_product_url }}">
  • This resolved some issues but still causes duplicate content flags across different product URLs

Open Question:

  • Seeking advice on whether it’s possible to keep collection names in product URLs while resolving the canonical and duplicate content issues

The discussion remains unresolved, with the user awaiting guidance on how to properly configure canonical tags or modify the theme’s URL structure.

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

Hi,

My website shows href lang issues in the site audit. It doesn’t show issues with the product links, but shows canonical and self referencing tag issues for product links with collection name in it. I am using Impulse theme and the href lang tags are auto generated from the theme and there is no section for editing. Please see the attached for reference.

Thanks in advance.

Hi @YasminAshraf ,

What theme are you using on your storefront? What tool did you use to audit your site here?

Hi @Victor_5 .

Thanks for the response. I am using the Impulse theme. And in the theme the product url is defined as product.url | within: collection. So, it causes the hreflang tag and self reference tag issues in SEMrush audit.

When I added {% assign canonical_product_url = product.url | within: collection %} instead of it solves the issue, but causes duplicate content issues for all product urls as they are pointing to different urls. Can we keep the product urls with collection name in it and solve the canonical and duplicate content issues?

Thanks in advance.