Remove | within: collection from Liquid templates
The most common source of duplicate product URLs is one line of Liquid code present in most Shopify themes, including Shopify’s own Dawn theme. In the product card snippet (typically card-product.liquid or product-card.liquid), the product URL is rendered as product.url | within: collection. This filter appends the current collection path to every product link, so every click from a collection grid lands on a collection-scoped URL instead of the canonical /products/ path.
The fix is replacing every instance of product.url | within: collection with simply product.url across your theme files. After this change, Googlebot follows clean canonical URLs from collection pages, and the collection-scoped versions stop receiving new internal link equity. Screaming Frog before-and-after crawls on our test stores showed a 60-80% reduction in collection-scoped URLs receiving internal links within two weeks of deployment. Check the Shopify duplicate content guide for the exact files to edit across popular themes.


























