Canonical URL issue Cannot find {{ product.url | within: collection }} anywhere.

Solved

Canonical URL issue Cannot find {{ product.url | within: collection }} anywhere.

SageFixer
Tourist
3 1 1

I use ahrefs.com to audit my website.  I have 500+ orphaned webpages "Canonical URL has no incoming internal links"

All of the webpages are www.sitename.com/products/productname 

 

My understanding is this is the canonical page and my site does not refer to this page.  All our products are in categories and display the noncanonical page name i.e. https://sitename.com/collections/collectionname/products/productname

I have found a few people having my same issue and the say just go into _____.liquid file and change {{ product.url | within: collection }} to simply say {{ product.url }}

I have looked everywhere for this.  I have looked in every .liquid file and I cannot find {{ product.url | within: collection }} anywhere.  Can anyone help me out?

Accepted Solutions (2)
LitExtension
Shopify Partner
4941 1008 1186

This is an accepted solution.

Hi @SageFixer,

I checked the attached link and couldn't find any information about the theme.

You can go to Actions > Edit code, find 'product' and search for the code in the files of the snippets folder. Example for dawn theme is:

Screenshot.png

Hope it helps!

 

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com

View solution in original post

SageFixer
Tourist
3 1 1

This is an accepted solution.

Thank you so much! I found it under product-details.liquid

 

Very happy to have sorted this out.

Thanks again for your help!

View solution in original post

Replies 9 (9)

LitExtension
Shopify Partner
4941 1008 1186

Hi @SageFixer,

What theme are you using? please send me the theme name, I will check it for you.

About the code, the instructions you have read are correct, just change:

{{ product.url | within: collection }}

=>

{{ product.url }}

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com
SageFixer
Tourist
3 1 1

Wow, thank you so much, this is the theme I am using Production Remove MapBox 2.29.20

LitExtension
Shopify Partner
4941 1008 1186

This is an accepted solution.

Hi @SageFixer,

I checked the attached link and couldn't find any information about the theme.

You can go to Actions > Edit code, find 'product' and search for the code in the files of the snippets folder. Example for dawn theme is:

Screenshot.png

Hope it helps!

 

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com
SageFixer
Tourist
3 1 1

This is an accepted solution.

Thank you so much! I found it under product-details.liquid

 

Very happy to have sorted this out.

Thanks again for your help!

LitExtension
Shopify Partner
4941 1008 1186

Hi @SageFixer,

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
Contact us:
- Email: contact@litextension.com
nchachula
Tourist
4 0 1

Hello, 
I found the code {{ product.url | within: collection }} in my product-grid-item.liquid file. However it is found 3 separate times, grid product link, add to cart and sold out. Do I change for each occurance? 

MSGowtham
Shopify Partner
15 0 1

Hi @LitExtension 

I am using an Electro 6.0 theme and the same as well I am using ahref tool and it shows canonical error (no incoming internal links) and the orphan page (no incoming internal links) and  most of them say those 

{{ product.url | within: collection }}

=>

{{ product.url }}

 

Where do I find it in the electro 6.0 theme ? could you please check it for me and give a solution?

webifym
Shopify Partner
5 0 1

I have been trying to solve this for two days now and there is no clear and helpful answer on shopify.  I really don't understand WHY Shopify makes it sooo difficult for store owner - or even developers - to solve common and simple problems. So frustrating!

nathanhuffhines
Excursionist
22 1 6

Any ideas about where to do this within the Expanse theme? I can't find it.

 

Edit: found it. It's in product-grid-item.liquid