Why recommended products have extra params in URL?

Topic summary

Issue: Shopify’s recommended products feature automatically appends tracking parameters (e.g., ?pr_prod_strat=copurchase&pr_rec_pid=...) to product URLs, creating hundreds or thousands of duplicate URLs that appear in Google Search Console and potentially harm SEO.

Why Parameters Exist: These tracking parameters help merchants measure recommendation performance and conversions. Shopify documentation explains their purpose for analytics.

SEO Concerns: Multiple users report:

  • Hundreds to thousands of parameterized URLs indexed by Google
  • Canonical URL errors in Search Console
  • Potential slowdown of main page indexing
  • Loss of clean internal linking structure

Proposed Solutions:

Blocking approach (not ideal):

  • Add Disallow: /*?pr_prod=* or Disallow: *?pr_prod_strat=* to robots.txt
  • Insert noindex meta tags: {%- if canonical_url="*seq=uniform" -%}<meta name="robots" content="noindex, nofollow">{%- endif -%} in theme.liquid

Preferred solution (maintains internal linking):

  • Modify theme files (location varies by theme: card-product.liquid, product-thumbnail.liquid, product-grid-item.liquid)
  • Change {{ product.url }} or {{ card_product.url }} to {{ product.url | split: "?" | first }} to strip parameters
  • For Dawn theme: Update lines 113, 157, and 235 in card-product.liquid

Consensus: Removing parameters via code modification is better than blocking, as it preserves internal linking benefits while eliminating duplicate URL issues. Track recommendations using GA4 events instead.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

I am showing the recommended products in PDP.

{%- for product in recommendations.products -%}
  <li class="product">
    <a href="{{ product.url }}">
     ...
    </a>
  </li>
{%- endfor -%}

But the products have long URLs.
https://[store]/products/red-hat?pr_prod_strat=copurchase&pr_rec_pid=2264152113206&pr_ref_pid=2264163287094&pr_seq=uniform
Is it possible to show products with a short URL like https://[store]/products/red-hat ?

Hi Yu727,

Those parameters are there for tracking purposes. I don’t recommend removing them as you wouldn’t know how the recommendations are performing.

You can find mentions to these parameters in the links bellow:

https://help.shopify.com/en/themes/development/recommended-products

https://help.shopify.com/en/themes/development/recommended-products/using-json-api#tracking-conversions-for-product-recommendations

Hi Vellir,

Is this feature automatically added on venture theme?

I have hundreds of new pages on my google search consoles with similar Url as the one in the question. I am not using any recommendation features from my theme or from the app. I was surprised to see 1k+ new urls in my search console. I believe it makes my other main pages slower to get indexed…

Any insights?

Cheers

Hi @Vellir

The URLs with parameters from Recommendations section are a problem for SEO. Any idea how to link the clean URL of the products?

Thanks

Same here @Vellir Hundreds of URLs with that parameters are indexed. What’s the solution?

Hi, I have tried to do noindex that urls but it is not working. I added to theme.liquid:

Any help about it?

My reply above is answering the original question only: “Why Recommended Products Have Extra Params In URL?”

Also, based on some other posts above some themes can also modify the URLs.

However, it seems most people here want to remove the extra parameters regardless.

It doesn’t look like there’s a universal solution to remove the query parameters but I’m happy to help everyone individually (or at least try). Please PM me your details if you wish me to have a look.

We can share the solution here if find one.

Is it possible for us to set the “Disallow: / xxxxx” in our robots.txt file to avoid search consoles crawling this long and meaningless URL by adding a robots.txt file or altering it via google’s robots testing tools?

If this is feasible, then what should it be “Disallow: / xxxxxx”?

Sorry, I did a mistake copying the code. The good code will be;

{% if handle contains ‘seq=uniform’ %}

{% endif %}

1 Like

Hello Frankymartin,

have you found any solution with this code ?
I have facing same problem with extra url parameters.

Hey @frankymartin

I will try this code snippet in my theme.liquid. did you already find out if its working properly?

I mean this one:

{% if handle contains ‘seq=uniform’ %}

{% endif %}

I have the same issue but I am not a developer and I don’t know how to fix it. Does anyone have a solution? I have hundreds of canonical URLs, and I am trying to work on SEO.

Hi guys,

Think i might have a solution for this.

You can disallow these pages using the robots.txt file which helps to control which pages are crawled on your site.

You can search for robots in your theme files to locate this or If you haven’t created one follow the instructions below:

  1. From your Shopify admin, click Settings > Apps and sales channels.

  2. From the Apps and sales channels page, click Online store.

  3. Click Open sales channel.

  4. Click Themes.

  5. Click Actions, and then click Edit Code.

  6. Click Add a new template, and then select robots.

  7. Click Create template.

Then in the robots.txt add a disallow rule for these parameter:

Disallow: /?pr_prod=

Hope that helps - let me know if you need any more info!

This is an update for the piece of code, and the piece finally works for me. See the screenshot from Google Search Console.

The code is here:

{%- if canonical_url=“*seq=uniform” -%}

{%- endif -%}

Put the code at the end of your theme.liquid file.

2 Likes

Great!! So, the codes to insert are:

In theme.liquid (to do noindex):

{%- if canonical_url=“*seq=uniform” -%}

{%- endif -%}

{% if handle contains ‘seq=uniform’ %}

{% endif %}

In robots.txt (to block crawler):

{%- if group.user_agent.value == ‘’ -%}
{{ 'Disallow: /products/
?pr=*’ }}
{%- endif -%}

I know I’m late to answer this, but I wouldn’t advise necessarily just blocking the URLs in robots.txt file as you’re losing a lot of internal linking. Ideally, you’d find a way to remove the params from the URL (I’m currently looking into doing this myself). That way you keep the internal linking but remove the proper canonical error in GSC. You can track ‘recommended products’ performance using GA4 and create an event specifically for recommended product clicks.

2 Likes

I agree with @batfink1989 . Looking forward for the solution.

1 Like

The solution to this varies from theme to theme but it’s something along the lines of changing {{ product.url }} to {{ product.url | split: “?” | first }} in the relevant theme file that contains the ‘recommended products’ liquid.

I’ve changed a few of these now and they were in different places and named different things (e.g. one file was named “card-product.liquid” while another was named “product-thumbnail.liquid”), but you can work out where you need to change this with a bit of digging.

By changing this code, the URL that is generated no longer includes the recommended product params but still includes the link to the canonical product URL, meaning you get a clean-looking URL and some 'brownie points’ for internal linking too.

Hopefully, this helps. I’d be happy to help anyone who needs some guidance, whether that’s to do with this specifically or the GA4 tracking that you may want to implement afterwards.

5 Likes

@Highbeam hope this helps :+1:

Hi, well done for that! I’m a seo and that would be the ideal solution.

However, in my case I can’t find this {{ product.url }} in my recommendation section. If you have any tips on what to change here..

https://ibb.co/kHCswDs
https://ibb.co/MR0r30z