Duplicate Content - Same Page with different url

Pingxiang_Wang
Tourist
5 0 2

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 39 (39)
Pingxiang_Wang
Tourist
5 0 2

anyone could help?

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 }}”>

 

edgarmichel
New Member
1 0 2

For shella theme: Go to snippet -> product-res-variables.liquid -> Line 22 -> Change {%- assign url = product.url | within: collection -%} in to {%- assign url = product.url -%}

grotful
Shopify Partner
12 0 12

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

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.

leonine
New Member
1 0 0
bcarvalho_dgs
New Member
1 0 0

For the Wokiee theme, you can edit this in Snippets under product-grid-item-design-1.liquid
It's in a few places in that liquid file. 


StuartAK
Tourist
6 0 8

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

6batigoal
New Member
2 0 0

After opening literally every .liquid, found it in the product-thumbnail, i'm so stupid haha

eplewes
New Member
2 0 0

Hi where would I find this for the Responsive theme?

sandy786
Tourist
11 0 9

I have the same issue. I need my product page needs to be indexed instead of the collection page.

how can I do it??

 

lkstar
Excursionist
23 1 3

Hi - I can't find this code in the corresponding snippet in the minimal theme... can you point me in the right direction? many thanks! lk

User17
New Member
1 0 0

I am also looking for this code in the minimal theme..

Gago
New Member
7 0 0

Hello everybody,

I have modified the code in snippets for my theme "Debut", however  the links for both [product] and [product in collection] still work separately. Could anybody give further instruction?

Appreciate!

SarahMMoore1
Excursionist
14 0 6

Has anyone figured out how to do this with the minimal theme?

 

PWJ
Tourist
9 2 5

For Minimal theme go to Snippets > product-grid-item.liquid

On about line 25 you should see a line that starts with <a href="{{ featured.url | within: collection }}" change this part to <a href="{{ featured.url }}"

Basically deleting | within: collection from the link. This should give all your product pages URLs of the form "site/products/product-link". It does alter the breadcrumb links so that rather than having Home > Collection Link > Product Link if you've navigated via a collection it changes the breadcrumb to Home > Product Link instead.

MS_SBP
New Member
1 0 0

I'm using the Minimal theme, but I have no product-grid-item.liquid under Snippets. Can you advise? Thanks. --MS

ScullysLLC
Tourist
10 0 1

I am currently having this same issue with the minimal theme but I don't have the code that you are referencing here. I do have the file product-grid-item.liquid but it doesn't have the within: collection code. Do you have any other suggestions? Thanks. 

BrianDR
Excursionist
12 0 3

@ScullysLLC - Ultimately, I solve the issue through an app that happened to fix this.  The app is Boost Product Filter and Search.  I have used that app for over a year to get more robust product filtering on collection pages.  They have a setting that allows you to "Use Canonical URLs for Product Pages".  That did it!

happylife
Tourist
7 0 2

I have the same problem. After I adopted your code, my collections URL became what I wanted,

https://www.kuoser.com/collections/dog-jackets-coats

But my breadcrumb lack collections. Any ideas on the complete breadcrumb?  What code should i add?

https://www.kuoser.com/products/plaid-reversible-dog-winter-jacket

20211027.png

 

IntellitonicSEO
New Member
1 0 0

Hi folks, 
Late to the party but we did some digging last year and found a solution to the duplicate product URLs. The theme.liquid file varies, but this should be able to point people in the right direction. https://intellitonic.com/blog/an-seo-tutorial-for-handling-shopifys-duplicate-collections-and-produc... 

BrianDR
Excursionist
12 0 3

Great article.  I am using the Flex theme from Out Of The Sandbox. 

 

After going through all of the liquid files in FLEX, I found:

 

 <a href="{{ product.url | within: collection }}">

 

in a few  locations:

 

product-slider.liquid 

product-thumbnail.liquid

product-thumbnail__product-info.liquid 

product-thumbnail__quick-shop-button.liquid 

include-featured-product.liquid

product-thumbnail__swatch.liquid - *this file is actually handling {{ variant.url | within: collection }} 

I've altered all but the last...removing the 'within:collection'.

Unfortunately, there is no change.  

Any ideas as to what I am missing?

Bbouttemy
New Member
4 0 0

Hi I've the same issue.
Did you find a solution to put back your collections links in your product page ?

Pingxiang_Wang
Tourist
5 0 2

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

Pingxiang_Wang
Tourist
5 0 2

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 6

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
Excursionist
15 0 4

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
Excursionist
15 0 4

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

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!

RonnyWAF
Shopify Partner
6 0 1

I have now gone through the code of all the pages. Does anyone have any idea where I can find this in the theme Context (by Fluorescent)?

RonnyWAF
Shopify Partner
6 0 1

I have searched myself silly in the .-liquid files, but unfortunately could not find anything so far. Maybe someone knows where I can find the code line in the Sense theme.

Halfpipe75
Excursionist
16 1 4

Wow,  5 years on from the original issue and this is still an issue.

Shopify developers have not learnt that the original issue of canonical duplicates, stop your website being crawled by google. i Currently have 5000+ pages not crawled or listed on google because of this issue.

Shopify support's response is to connect to shopify experts that want to charge me $400+ to fix the issue, when I'm reading I can just change a piece of code (but I can't locate it in the refresh them). 

I think it's time to take my business elsewhere away from shopify and the lack of support is shocking.