Hide a collection of Products From Product Recommendations

I am looking to hide a selection of products from my product-recommendation section. I tagged all these products with _hidden so they are automatically added to a collection called “Hidden”. I want to hide this collection from my recommendations section.

Here is the code for product-recommendations.liquid not including the schema. i know i need an if statement but don’t know where to put it.

{%- assign use_recommendations = true -%}
{%- assign hand_picked_count = 0 -%}

{%- for block in section.blocks -%}
  {%- if block.settings.product != blank -%}
    {%- assign use_recommendations = false -%}
    {%- assign hand_picked_count = hand_picked_count | plus: 1 -%}
  {%- endif -%}
{%- endfor -%}

{%- capture section_settings -%}
{
  "productId": {{ product.id | json }},
  "useRecommendations": {{ use_recommendations | json }},
  "recommendationsCount": 4
}
{%- endcapture -%}

{%- capture flickity_options -%}
{
  "prevNextButtons": true,
  "pageDots": false,
  "wrapAround": false,
  "contain": true,
  "cellAlign": "center",
  "watchCSS": true,
  "dragThreshold": 8,
  "groupCells": true,
  "arrowShape": {"x0": 20, "x1": 60, "y1": 40, "x2": 60, "y2": 35, "x3": 25}
}
{%- endcapture -%}

I solved myself.

can you tell me how you solved this? I need to do the same thing

Fake news. The solution I used didn’t work, BUT I stopped using the recommendation engine that is built in and started using a different app for it. it was not cheap. the solution I used before this was just setting whatever products I want as the featured products.

OKay thanks I appreciate it. I have the recommendations turned off
completely right now which is not good. appreciate the reply!

I found this solution on a different thread, tested it and it works for me: https://community.shopify.com/c/technical-q-a/is-there-a-way-to-hide-specific-products-from-the-product/td-p/1213359