Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi i have added this code on my website to display the actual canonical url and so it doesn't show page-2 and the canonical now links to my primary domain .nl instead of .be for the market belgium.
how do i now implement this code but also for the homepage and product page?
{% if template contains 'collection'%}
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
To implement the code you have provided for the homepage and product page, you can use the following steps:
head
section of the template file.head
section:
{% if template contains 'collection'%}
<link rel="canonical" href="{{ shop.url }}{{ collection.url }}" />
{% else %}
<link rel="canonical" href="{{ canonical_url }}" />
{% endif %}
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025