How to remove collection page in URL of each products

I want to avoid cannibalism in our site or canonical issues

I want to fix our product page URL to this

https://www.domain.com/products/boost-light-electric-height-adjustable-single-sided-workstation

instead of this

https://www.domain.com/collections/height-adjustable-standing-desks/products/boost-light-electric-height-adjustable-single-sided-workstation

And is it correct Google should indexed this kind of URL Structure?
https://www.domain.com/products/boost-light-electric-height-adjustable-single-sided-workstation

Hi @MsMarj

You can remove it from the URL only when visitors open products from collection pages by deleting this part in "| within: collection" in collection liquid file.

If they open directly within the collection in the URL, then they cannot be removed.

Hi @MsMarj ,

May I suggest to update it these steps:

  1. Go to Store Online-> theme → edit code

  1. snippets/card-product.liquid

  2. Remove "| within: collection"

Hi @Dan-From-Ryviu

I check on my backend I don’t have this collection liquid file

Hi @EBOOST appreciate your response. I check on my end we don’t have this snippets/card-product.liquid

Hi @pwcsangeeta

Thank for taking time to response.

On my end I don’t have this card-product.liquid

Would you share your store URL to check?

Here @Dan-From-Ryviu

https://www.areaoffice.com.au/

Hi @MsMarj

Please check and remove that part in product-grid-item.liquid file.

1 Like

what specific code will I remove on product-grid-item.liquid ?

Find this part and remove from your file

| within: collection

1 Like

All good now @Dan-From-Ryviu Thank you so much

1 Like

You are very welcome!

You can remove /collections from URL in your shopify store.