Shopify URL & SEO Query - /Collections on product page URL

Hello guys,

I have just joined Ahrefs (SEO tool).

It’s flagged an error that many product pages don’t have any incoming direct internal links.

I believe this might be because to get to most product pages online, customers will often click via collection pages adding a “collections/bang-energy/” to this product for example https://proteinpackage.co.uk/products/bang-energy-zero-calorie-energy-drink-bangster-berry so that it displays as https://proteinpackage.co.uk/collections/bang-energy/products/bang-energy-zero-calorie-energy-drink-bangster-berry.

This means there are many canonical but no actual direct ones which Ahrefs says might negatively impact SEO and is classed as an error.

Is there a way to remove the “/collections/xxxxxx” after you click from a collection?

Finally, what are your thoughts on this? Is there any reason you’d advise against making this type of change?

Images are attached for reference.

Many thanks,
George Greenhill

@George_Greenhil

sorry for that issue

its dynamic shopify code doesn’t possible to change code

Is there a way to remove the “/collections/xxxxxx” after you click from a collection?

So the URL routing in Shopify is not flexible, but you can easily change the internal linking.

Just find something like this in theme code:


Then remove the **| within: collection** bit so you are left with:

```css

Typically you'd find that within your collections.liquid somewhere - but every theme is a bit different, it may be in a nested snippet or something else. Easiest way I find is to use the Bold theme search extension and find "within: collection" usually that does the trick. Then surgically find/replace.

The effect of this is that collection pages will no longer link to **/collection/abc/products/xyz pages** and instead they'll link directly to **/products/xyz** pages. The down-side is you loose breadcrumbs and need a bit of customization to get them back.

Personally I prefer doing this on most Shopify stores, as it sends a stronger signal about which pages are important (canonical tags can a bit weak and get ignored by Google), it helps internal pagerank/link equity flow, helps simplify reporting etc. Technically the dupe pages will still exist and be accessible to direct type in traffic - but with no internal links they should eventually disappear if they happen to be indexed in Google. Should sort out those errors in Ahrefs too.

Just a side-note with SEO tools; it's important to *understand the context and why* you're fixing things. Simply taking automated audit reports like that at face value, is okay but can sometimes lead you to fix technical things that are really not big problems in the scheme of things.

Hi Kieran, I have carried out this process for better SEO however like you have stated i have lost breadcrumbs so google thinks that there are no internal links to all the products. What is a solution to fix this internal linking ? https://bingleyfencing.co.uk/

I have a bit of code experience but i have husband to help me but i am unsure of how to fix? Or if i need to …

Removing the within collection has had positive impact on SEO but obviously this has kicked up this error !

Any ideas?

Yeah expected, sadly.

The fix I’ve applied in the past is something like:

  1. Add metafield for each product with list of parent breadcrumbs up the tree.
  2. Add custom code to show breadcrumb on website and schema.

Exact steps will be theme and schema implementation dependent.

We can customize our shopify store URLs for better SEO