Hide products from search with title or product type

Hello,

I’ve come to ask you for help because even after several attempts I can’t manage to do what I want.
I would like to hide some products from the search of my site, but while keeping them active on it.
It should also be done automatically so that I don’t have to make changes in the backend. The theme on which I want to do this is “Expanse”.

I tried to add a condition in the code of the search.liquid page according to the title of the search item or the type of the item (i.e. the type of product) but it does not work. Here is an example of what I added but not working:
{%- for item in search.results -%}
{%- if item.title contains ‘Marking fees’ -%}{% continue %}{% endif %}

Could you please help me?

Hi, have you had any success with this or found a solution yet?