{%- 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 ?
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…
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.
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”?
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.
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.
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 'browniepoints’ 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.