Blocking Products from Shopify Search and Product Recommendations AI

Topic summary

A merchant is seeking to hide $0 digital gift products from appearing in Shopify’s search bar and product recommendations. These items are automatically added to carts when customers purchase other products.

Proposed Solution:

  • Tag the free digital products with a specific identifier
  • Use Liquid code with the unless operator to exclude tagged products from display
  • Apply filters in both search results and product recommendation sections

Implementation Details:

  • CrunchyBytes provided code snippet: {% unless product.tags contains 'tag_name_here' %} to conditionally hide products
  • Shared external guides for hiding products from Shopify search and Google search
  • Provided a separate solution for removing items from product recommendations
  • Offered personalized assistance to help implement the code in specific theme files

Current Status:
Another user (IsraelGranja93) using the Sense theme attempted the solution but encountered difficulties and requested additional help. The discussion remains open with ongoing troubleshooting.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Hello,

I recently added digital products that are $0 and are added as gifts when a customer adds another product to their cart. But I am noticing these products are appearing in my search bar and I am also afraid they will start to appear in product recommendations. Is there any way to block specific products from appearing in these fields?

Sample Product: https://wearthepeace.com/products/your-purchase-is-providing-a-brand-new-article-of-clothing-to-a-human-in-need?variant=43073684144382

Thanks!

Hi,

You can add a tag on those digital products that are $0 and when search results are displayed. Add some liquid code to hide those products.

Thank you for the suggestion, do you know what liquid code that would be?

{% unless product.tags contains 'tag_name_here' %}
   {% include 'product-grid-item' %}
{% endunless %}

Here is an example, you can use the “unless” ternary operator to do so.

However, you may need to look at this solution to hide the items from the search.

https://community.shopify.com/topic/1292089

Thank you for the information, where would I add this?

To hide in the search bar I recommend using this, recommendations might be a little bit more difficult. However, I will update you when I find the correct solution. This guide will wall you through step by step on how to remove it from shopify + google search.

https://rusticated.co/ecommerce/shopify/how-to-hide-products-from-shopify-search/

Here is a viable solution to hide them from product recommendations too! Read through the entire post so you can see which file to alter. Also, if you have trouble then just shoot me a reply or DM and a copy of your current file code, and I will show you where to put it.

https://community.shopify.com/topic/1319310

Hi! Im facing the same issue and I’m using the sense theme. I tried following the post but could find my way around it. Could you pleas help me?