A Shopify store owner wants to remove the /collections/ segment from product URLs, seeking to shorten links from domain.com/collections/collection-name/products/product-name to domain.com/products/product-name.
Proposed Solutions:
One responder suggested editing URL handles in Shopify admin (for products and collections), providing step-by-step guides via Tango links.
Another user clarified this doesn’t remove the /collections/ path structure itself, which is controlled by Shopify’s core system and cannot be modified.
A code-based workaround was offered: locate {{ product.url | within: collection }} in collection template files and remove the | within: collection filter, keeping only {{ product.url }} to eliminate collection references from URLs.
An alternative suggestion involved using third-party URL shortener apps available in the Shopify ecosystem.
Status: The original poster confirmed the admin-level URL editing didn’t solve the issue. The discussion remains open, with the code modification approach and URL shortener apps as potential alternatives, though no confirmed resolution has been marked.
Summarized with AI on October 25.
AI used: claude-sonnet-4-5-20250929.
From the collection file replace the code ( Don’t know the exact file but you can search the code in collection files )
{{ product.url | within: collection }}, you will need to remove |within:collection and keep only {{ product.url }} it will remove the collection reference from the URL.
Hey @asajce If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.
Hey @asajce
If the solution presented meets your needs and addresses your query effectively, I encourage you to accept it as the chosen answer. This will acknowledge the support you received and aid fellow community members in identifying reliable and effective solutions for their similar concerns.
Thank you.