I have the theme Icon, I am having an issue with some of my products’ URLs some have collection, and some just product. I want to remove the collection of the URL. I have looked at some discussions and mentioned going to product-grid-add.liquid and removing {{ product.url | within: collection }} to replace it with {{product.url}}. But nothing has changed on the URLs.
The Shopify generated URLs are not customizable, only the handles are. The structure of our URLs are designed to be visually simple, speedy and secure. Shopify is built on Ruby on Rails which uses something called “routing” that uses paths to pull information from your admin. Attempting to alter this within the code of your store can be detrimental to your customer experience, SEO and overall function of your website.
Anything after /products/ or /collections/ can be edited within the SEO settings of any given page. A successful redirect will be put in place for any changes made to an existing handle.
I hope this helps. If you have any other questions, please let me know.
Thank you for your quick response I will change the code back to its original coding.
I really need to understand why is this happening in the first place, why are some of my products pages URLs different? It doesn’t make any sense why some URLs have collection/product/product and some simply have /product ? I need to have all my URLs links like this below :
Hi @Rox1 - thanks for getting back to me. Once your revert the code back to the original format, are you still seeing the URL with duplicate product handles?