Taming Duplicate Collection URLs: A Shopify SEO Fix for '/collections/all/' Pages

Hey there, fellow store owners! Let's talk about a common SEO headache that often pops up in the Shopify community: those pesky duplicate collection URLs. Specifically, I'm talking about the difference between your neatly organized /collections/shirts pages and the automatically generated /collections/all/shirts pages that come from product tags.

It's a conversation that recently brewed in the Shopify forums, started by a merchant named pdintane, who perfectly articulated the dilemma. On one hand, you've got your primary collection pages, often with custom copy and curated products, like /collections/shirts. On the other, your product pages, by default, might be generating links like "Products Tagged Shirts" that point to /collections/all/shirts. The content on these pages is often near-identical, but the URLs are distinct. The problem isn't usually with user experience – customers likely won't notice – but for search engines, it's a classic case of duplicate content, which can dilute your SEO efforts and confuse crawlers.

Understanding the Duplicate Content Challenge

As pdintane explained, the core issue is that Shopify doesn't offer a native way in the admin to tell Google "Hey, these two pages are essentially the same, but this one is the master." This is where rel="canonical" tags come into play. A canonical tag is like a gentle hint to search engines, guiding them to your preferred version of a page when multiple similar pages exist. It's generally a much better approach than using 301 redirects for internal links, which can sometimes create unnecessary redirect chains and complicate internal link equity.

The community quickly rallied with some fantastic insights. One key takeaway, highlighted by SEOLab, is to first check if those /collections/all/... pages are actually receiving meaningful traffic or impressions. If they're not doing anything for you, then simplifying your internal linking structure so users and crawlers naturally find the preferred pages can resolve a lot of the problem with less ongoing maintenance.

The Two-Pronged Solution: Canonical Tags & Source Link Fixes

The general consensus from experts like smith153, Steve_TopNewYork, and oscprofessional is that you're looking at a two-pronged approach. You need to:
1. Implement custom canonical tags in your theme code.
2. (Crucially!) Fix the internal links that are generating those /collections/all/ URLs in the first place.

Prong 1: Implementing Custom Canonical Tags in Your Theme

Since Shopify doesn't have a built-in dashboard for custom collection canonicals, you'll need to dive into your theme code. Don't worry, it's not as scary as it sounds, especially with the clear guidance from community members like ajaycodewiz and PieLab.

Here's how you can set this up:

  1. Access Your Theme Code: From your Shopify Admin, go to Online Store > Themes. Find your current theme, click Actions, and then Edit code.
  2. Locate theme.liquid: In the file explorer on the left, open the layout/theme.liquid file. This is where your site's main HTML structure lives, including the default canonical tag.
  3. Find the Default Canonical Tag: Search for . This is the line you'll be replacing.
  4. Add Custom Logic: Replace that single line with a conditional Liquid block. ajaycodewiz provided an excellent, robust example that handles both direct matches and those tricky mismatches (like "blouses" needing to go to "womens-shirts").

    {%- liquid
      assign can
      if collection.handle == 'all' and current_tags.size > 0
        assign origin = canonical_url | split: '/collections' | first
        assign t = current_tags | first | handleize
        assign target = t
        # tags whose collection handle differs from the tag:
        if t == 'blouses'
          assign target = 'womens-shirts'
        endif
        assign can | append: '/collections/' | append: target
      endif
    -%}
    

    This code intelligently checks if you're on an "all" collection page with tags. If so, it takes the first tag, "handleizes" it (makes it URL-friendly), and then checks for any specific mismatches you've defined (like "blouses" going to "womens-shirts"). For any tag that *doesn't* have a specific override, it defaults to a collection page with the same handle as the tag (e.g., /collections/all/shirts/collections/shirts).

    Remember, you'll need to add an if t == 'your-tag' line for each tag that maps to a collection with a different handle.

    After implementing, make sure to test! As rshrivastava63 reminded us, viewing the page source to confirm the canonical tag is correct, and then using Google's URL Inspection tool in Search Console, are essential steps. You want to see "Google-selected canonical" match your declared one.

    Prong 2: Addressing the Source – Fixing Internal Links

    This is where Maxime from StoreCanary really hit on a crucial point: Google may not fully respect those canonical tags if your internal link signals are constantly pointing to the "wrong" URL. The more durable fix, as many experts agreed, is to actually modify the source of those "Products Tagged X" links.

    These links typically come from your product template, often generated by something like product.tags | link_to_tag in Liquid. You'll need to:

    1. Find the Tag Output: Go back to your theme code editor. Look for your product template files (e.g., sections/product-template.liquid or a snippet like snippets/product-card.liquid). Search for product.tags or link_to_tag.
    2. Modify the Link Target: Instead of letting link_to_tag automatically create a link to /collections/all/shirts, you'll modify it to point directly to your preferred /collections/shirts. For those specific mismatches (like blouses to womens-shirts), a simple case block in Liquid can handle it cleanly. This stops Google from continuously getting crawl signals for the pages you're trying to suppress.

    Fixing the internal links is what removes the internal pressure on Google and reinforces your chosen canonical URL. It's a "belt and suspenders" approach that gives you the best chance for SEO success.

    Final Thoughts and Considerations

    Before you go all-in on this, rshrivastava63 brought up an important point: make sure those tag pages truly don't have unique value. In pdintane's case, the preferred collection pages do have custom copy, so canonicalizing makes perfect sense. But if your /collections/all/shirts page had completely different content or filtering options that were valuable to users, you might want to rethink consolidating it.

    Also, consider the scale. For a dozen or so custom mappings, manually editing the theme code is perfectly manageable. But if you're dealing with hundreds of unique tags and complex mappings, maintaining that code can get unwieldy. In such cases, as PieLab mentioned, an app like SearchPie (or similar SEO tools) might offer a dashboard to manage these custom canonicals more easily, without constantly touching your theme code.

    Ultimately, by combining careful theme code edits for your canonical tags with a proactive approach to cleaning up your internal linking structure, you can effectively resolve this common Shopify SEO challenge. It's about giving clear, consistent signals to search engines, ensuring they index the pages you want them to, and ultimately helping your store perform better in search results.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases