Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi
ive been given a seo audit error saying my collections url only have one incoming internal link. however these are the same product pages, but the url is through the collections, therfore the url has collections in it too. how do i make it so that there arent 2 different urls for the same page.
for example:
https://infraredheatingsupplies.com › products › ceiling-brackets
https://infraredheatingsupplies.com/collections/accessories/products/ceiling-brackets
both pages are exactly the same. i think shopify has automatically made a canonical tag for these pages, but the seo audit still says the 2nd url only has one incoming link, when in reality it is the same product page which has quite a few internal links
hope this makes sense
please can someone help
Hey Ihs,
The code that's causing your site to have links that are /collections/collection-name/products/product-name, is this piece of code here:
{{ product.url | within: collection }}
This is likely to be located in the code that controls how a collection is being rendered in your page. To fix this, all you'll need to do is to change the code above into this:
{{ product.url }}
Hope this helps!
HI
where do i change this code? i seen this on another thread but could not find the liquid file for collections
Not entirely sure what your files look like or how they are named but try to look for the file named "featured-collection.liquid". That should be one place to look at
Use the Theme Code Editor. Themes > Theme of choice > ... > Edit Code. Then search for the file. Then by using CTRL + F, search for the code:
{{ product.url | within: collection }}
HI
i still cannot find this exact file, however i have checked my other files with the word 'collection', and then tried searching for the above in the code, but cannot find anything
my theme is Empire
HI
please can someone help with the above as i still cannot find the file where it says {{ product.url | within: collection }}
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024