Duplicate Content - Same Page with different url

New Member
5 0 0

https://giftforyou.store/collections/home-collection/products/wedding-guest-dress-for-women-spring-2...

https://giftforyou.store/products/wedding-guest-dress-for-women-spring-2018-valentines-gifts-for-wif...

This two links are exact the same content with different urls. One is home collection and one is clicked in other pages. 

How could I fix this or to get the home collection product link to redirect to the product link?

0 Likes
New Member
5 0 0

anyone could help?

0 Likes
Shopify Partner
12 0 3

This is intended behaviour from Shopify, it will create multiple links for each collection a product is in. This isn't a problem for duplicate content as the canonical link is always set to the original product (So, google is told where the original is and not to mark down for duplication).

However, if you do want to change this, it needs to be done in the theme's .liquid files that build the links to your products. This will vary theme to theme, but in "Supply" (the one I'm using) you can find the relevent line of code in the Snippets section, as "product-grid-item.liquid". We're looking for the link to the products, like this:

<a href="{{ product.url | within: current_collection }}" class="product-grid-item">

The important part is inside the brackets {{ }}. product.url is used to generate the url for the product, but this also has a 'within' filter applied to it. This within filter makes sure that the link that's generated includes a reference to the current collection. Seeing as you want the URLs all to point to /products/ you can just remove that filter. So that snippet would like like this:

<a href="{{ product.url }}" class="product-grid-item">

More info is available here: https://help.shopify.com/themes/liquid/filters/url-filters#within

1 Like
New Member
5 0 0

I would have a try. And thank you for the detailed explanation.

0 Likes
New Member
5 0 0

I have deleted the in both product-list-item.liquid and product-list-item.liquid, but it did not work. 

If someone share the link, there are two kinds. It would split the link juice, that's why I would like to change it. 

 

0 Likes
Excursionist
13 0 3

Thanks ! It worked for Brooklin theme. I cant believe Shopify marked this post as outdated and didnt even give us an answer on such an important topic 

0 Likes
New Member
5 0 0

I would love to know if anyone has a solution for this that would work for the Debut theme?  

 

I would like collection pages to point to the canonical URL for each product (i.e. /products/) rather than the default non-canonical URL (/collections/.*/products/).


0 Likes