How to Update Shopify PLP Collection Grids to Link to Canonical Product URLs

By James Brockbank

October 5, 2024 10 min read

Home / SEO / How to Update Shopify PLP Collection Grids to Link to Canonical Product URLs

Learn how to fix one of the most common Shopify SEO issues; collection/category page product grids linking to non-canonical product URLs.

There’s one really quick win SEO fix that I find myself recommending time and time again for Shopify sites. One that only takes minutes to implement.

Updating the product grid links on collection pages to point to canonical product URLs.

Keep reading to learn how to identify whether your Shopify store has this issue, why it matters, and how to fix it.

Want to jump straight to the code you need to update and which theme files you’ll find it in? Click here.

Understanding Shopify Product URLs

On Shopify, each product can be accessed through multiple URL paths, which can lead to duplicate content issues if not managed properly.

The canonical URL structure for Shopify products is:
/products/product-handle

Example: /products/blue-t-shirt

This is considered the primary URL for the product and is the one that you want search engines to index. The “product-handle” is a unique identifier that comes from the product’s title, unless otherwise changed.

When products are linked within collections, Shopify generates additional URLs that include the collection handle:
/collections/collection-handle/products/product-handle

Example: /collections/summer-collection/products/blue-t-shirt

These URLs show the product within the context of a specific collection, which can be beneficial for user navigation but can also cause problems for SEO.

You might also find that product URLs also include parameters or query strings for tracking or sorting purposes.

Example: /products/blue-t-shirt?variant=123456

While these are sometimes useful for functionality, they can create even more URL variations.

You want your product’s primary URLs to be the ones that are linked to from collection page product grids, but to know whether your store has this SEO issue, you need to figure out whether yours link to canonical or non-canonical product URLs.

It should only take a minute to check whether or not your site’s product URLs need updating.

Here’s how to find out.

Navigate to a Collection Page: Go to any collection or category page on your Shopify store where a product grid is shown. Open the page in your browser, not the Shopify admin panel.

Inspect the Product Links: Hover over a product image or title to see the URL it links to at the bottom of your browser window. Alternatively, right-click on the product link and select “Inspect” to examine it.

Check the URL Structure: If the product links include the collection handle (e.g., /collections/collection-name/products/product-name), they are pointing to non-canonical URLs. The canonical product URL should be in the format /products/product-name.

But before you update your product grid URLs, why should you fix this if the problem exists?

The good news is that most stores don’t need to worry about duplicate content from an indexing perspective; by default, product pages use canonical tags that reference the primary URL, which is the one without the collection handles.

Understanding canonical tags:
Canonical tags are HTML elements (<link rel="canonical" href="URL">) that signal to search engines which version of a webpage is the preferred or “master” copy. When multiple URLs display similar or duplicate content, canonical tags help consolidate these URLs into a single, authoritative version. This not only prevents potential duplicate content penalties but also ensures that all SEO value and ranking signals are directed to the canonical page, enhancing its visibility in search results.

This means that even if collection page product grids link to the URLs which include the collection handles, Google usually won’t index these.

The canonical tag references the primary URL, informing Google that that’s the one which should be indexed.

But while canonical tags are the preferential way to ensure duplicate collections don’t get indexed, they are not a guaranteed solution. Search engines treat them as hints rather than directives, and they may still index non-canonical URLs.

And that’s just one of the reasons you need to fix this issue if it exists. But other SEO issues with this linking internally to non-canonical URLs exist, too.

Diluted Link Equity: When you internally link to non-canonical URLs, you inadvertently split the link equity (PageRank) between multiple versions of the same page.

Instead of consolidating all the authority to a single, authoritative URL, you’re spreading it across two or more duplicates.

Understanding Diluted Link Equity:
Imagine you’re collecting votes to win a contest, and you have a choice: you can either gather all the votes for a single nominee or split the votes among multiple nominees who are essentially the same person under different names. If you split the votes, none of the nominees get enough votes to win. However, if you focus all the votes on one name, you significantly increase the chances of winning.

Similarly, when you spread link equity across multiple duplicate URLs, you’re dividing the “votes” that search engines use to determine page authority. By consolidating all the “votes” to a single, authoritative URL—the canonical URL—you strengthen its ability to rank higher in search results.

In turn, this dilution weakens the overall authority of your product pages, making it harder for them to compete on the SERPs. By ensuring that all internal links point directly to the canonical URLs, you focus link equity on the primary page, enhancing the page authority and improving your chances of ranking higher.

Confusing Signals for Crawlers: Search engines use internal links as one way to understand the structure and hierarchy of your website, as well as to discover new pages to index, and when your site contains multiple URLs for the same content, it sends mixed signals about which version should be indexed and ranked.

Understanding Confusing Signals for Crawlers:
Imagine someone trying to reach a specific destination using a map. If the map shows multiple routes to places with the same name but slightly different addresses, the traveler becomes confused about which path leads to the correct location. They might take a wrong turn or waste time exploring duplicate destinations that aren’t exactly what they’re looking for.

Similarly, search engine crawlers navigate your website using internal links as their map. When your site has multiple URLs leading to the same content, it’s like providing a confusing map with multiple paths to the same place. This can lead to crawlers indexing the wrong URL or splitting authority across duplicates, which dilutes your page’s ability to rank.

By linking directly to the canonical URLs—providing a clear and accurate map—you ensure that crawlers reach the correct destination efficiently. This clarity helps them understand your site’s structure and index the right pages, much like someone confidently reaching their intended destination with an accurate map.

This confusion can result in search engines indexing the wrong URL or splitting ranking signals between duplicates, ultimately hurting your SEO performance. By linking directly to canonical URLs, you provide clear and consistent URL paths for crawlers to understand, helping them index the correct pages.

Inefficient Crawl Budget Usage: Whilst there’s lots of debate about crawl budget, and the fact that most sites aren’t anywhere near large enough for you to need to worry about how many URLs Google’s got to crawl, you still don’t want it to be crawling pages unnecessarily.

After all, you want those pages which should rank (and be indexed) to be crawled, not duplicates. And giving search engines an easy path to discover the product URLs that include the collection handle (via product grid links) means they’re likely going to be crawled more frequently than your primary/canonical product URLs.

Understanding Confusing Signals for Crawlers:
Imagine you own a library with a limited number of librarians (search engine bots) who can organise books (web pages) each day. If you have multiple copies of the same book scattered throughout different sections (non-canonical URLs), your librarians waste time repeatedly organising these duplicates. This means they have less time to shelve new books or reorganize important sections. Consequently, people (users) might not find the latest or most valuable books because the librarians didn’t get a chance to place them properly.

Complicated Analytics and Reporting: Having multiple URLs for the same product can complicate your analytics and SEO reporting efforts.

Why? Because traffic, conversions, and user engagement metrics may be split across different URL versions, making it difficult to get an accurate picture of your product performance at URL-level.

This fragmentation can hinder your ability to make informed decisions about the organic performance of individual products, inventory management, and user experience improvements. By consolidating all user activity to the canonical URLs, you simplify your data analysis, enabling more accurate reporting and better strategic planning.

Ensuring that all collection page grid links point directly to the canonical URLs of your products might seem like a small issue, but it:

  • Consolidates link equity to strengthen page authority.
  • Provides clear signals to search engines about which pages to index and rank.
  • Improves crawl efficiency, allowing search engines to focus on your most valuable content.
  • Improves user experience by providing consistent and reliable URLs.
  • Simplifies analytics, giving you clearer insights into your site’s performance.

If this issue exists on your store, it needs fixing. Here’s how…

Fixing this issue involves updating the product grid links on your collection pages to point directly to the canonical product URLs.

This can be done by making a few edits to your Shopify theme’s Liquid code.

Open your Theme’s Code Editor: Open your theme’s code editor. Find the ‘Themes’ menu item under ‘Online Store’ in the sidebar. Once you’re in here, you’ll see a ‘Customize’ button under your active theme. Click the three dots to the left and open the ‘Edit code’ window.

Locate the Product Grid Code: You need to identify the template in your theme that controls the product grid within collection pages. This is typically found in the product-grid-item.liquid file, but this could be different depending on your theme. If using a custom theme and cannot locate a liquid file with this name, speak with your developer.

Update the Product Link Code: Shopify typically uses the {{ product.url | within: collection }} variable to link products within grids, and this is what causes the issue of linking to non-canonical product URLs. To fix the issue, update the link code to use the product’s canonical URL by replacing it with {{ product.url }}.

The original code will look something like this:
<a class="grid-view-item__link grid-view-item__image-container" href="{{ product.url | within: collection }}">

The updated version should look like this:
<a class="grid-view-item__link grid-view-item__image-container" href="{{ product.url }}">

Ignore the classes; these could be different in your theme. It’s the variable within the {{ }} we’re changing.

It’s that simple: changing {{ product.url | within: collection }} to {{ product.url }}. That’s all there is to it.

You don’t want to be linking to these non-canonical product URLs from anywhere within your site; and this means that if you’ve added internal links within blog posts or have a ‘recommended products’ or ‘recently viewed’ block, you’ll need to make sure these point to the canonical URL, too. They often will, as they’re typically category-agnostic, but you’ll want to double check.

It shouldn’t take long to roll out this fix, and if you run a Shopify store, I encourage you to go check this issue out. I’m pretty confident at least 50% of you will find yourselves needing to fix this, based on my own experience working with eCommerce brands running on the platform.


Need help rolling out a successful Shopify SEO strategy? Request a quote and we’d love to chat over your goals and share how we can help you not just meet, but exceed, them.

Our work wins us awards…

    Let’s talk.

    We'd love to chat about your project and share our insights into how we could work together to drive ongoing success and help you gain a strong competitive advantage.

    What can we help you with?