Remove "| within: collection" from theme templates
This is the fix that matters most when fixing Shopify’s forced collections-all duplicate URL paths. In your theme, every product card that links to a product via {{ product.url | within: collection }} outputs a collection-scoped URL like /collections/all/products/your-item instead of the canonical /products/your-item. Replacing every instance with {{ product.url }} consolidates all internal link equity onto the canonical URL.
The files to check depend on your theme: Dawn and Shopify 2.0 themes use main-collection-product-grid.liquid and card-product.liquid; older themes use product-grid-item.liquid or product-card.liquid. Use the theme code editor’s global search for within: collection to catch every instance. Always duplicate your theme before editing. For related SEO improvements, see our guide on Shopify SEO fundamentals.


























