FROM CACHE - en_header

Duplicate Content - Same Page with different url

Pingxiang_Wang
Tourist
5 0 1

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?

Replies 33 (33)
Pingxiang_Wang
Tourist
5 0 1

anyone could help?

grotful
Shopify Partner
12 0 11

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

Pingxiang_Wang
Tourist
5 0 1

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

Pingxiang_Wang
Tourist
5 0 1

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. 

 

Ana_Buendia
Excursionist
17 0 5

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 

kvg_australia
Tourist
8 0 3

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/).


JackpotGifts
New Member
1 0 4

Hey there,

 

For Debut, all you need to do is locate the file "product.card.grid.liquid" under "snippets" and change line 2 the same way that was mentioned above.

 

So change:

 

<a class="grid-view-item__link grid-view-item__image-container full-width-link" href="{{ product.url | within: current_collection }}">

 

to:

<a class="grid-view-item__link grid-view-item__image-container full-width-link" href="{{ product.url }}">

 

WOOT!

kvg_australia
Tourist
8 0 3

Thank you.  Actually I have since changed to Turbo theme... I'm hoping this fix will work there too!

metapro
New Member
1 0 1

Theme: Mr Parker
For theme: Mr Parker, all you need to do is edit code under snippets,  locate the file product-listing.liquid and change lines 1 and line 32

Line 1 and 32 from:
<a href=”{{ product.url | within: collection }}”>

Line 1 and 32 to:
<a href=”{{ product.url }}”>

 

WheelMan
New Member
1 0 0
  • Hi @kvg_australia - did you ever find a solution for this in Turbo? Which file needs to be edited as there does not appear to be one of the same name mentioned in the Snippets folder. Thanks
IndigoAntiques
Tourist
8 0 2

Hi,


Turbo you can fix this by editing the product-details.liquid snippet

JonathanDiane
Tourist
24 0 1

Hello,

 

I have a Venue Theme and I installed the Smart Filter App.

I have several links for the same final product url and I do not find where I can remove the text you mention;

 

Could someone help me on this?

 

Thanks!

JP30
Tourist
14 0 1

Hi there, 

 

Any idea where to look on the venture theme ? 

 

I've been looking through many files and did not come with the URL structure 

{{ product.url | within: current_collection }}

Thanks 🙏  

JP30
Tourist
14 0 1

OK I found it in product-card.liquid

跨境新手
New Member
1 0 0

The URL is unified,but the website name appears in the product title.

StuartAK
Tourist
6 0 6

Hi,

I am trying to make this correction with the Parallax theme but am unable to find the correct file in Snippets.  I have searched all the templates that begin with "product."  Can you please throw me a line here?  What file would I find it in?

 

Thanks,

Stuart

DaelenForge
New Member
1 0 0

Did you figure this out? I am using the same theme. 

6batigoal
New Member
2 0 0

I am using the Mobilia theme, did anyone find the snippet/line for that one?
Been looking for almost an hour and still not finding it ...