Hi @KatKat1 for solving coding|technical issues like this to drastically increase your chances of solutions in the future, it helps to show at least some legwork and reduce the problem and provide minimal code in the post itself to be considerate of other peoples time. Most of the time you’ll just become another ignored post because who wants to read a 1,000+ word tutorial to figure out which parts your referring too and THEN “rewrite” the whole thing, or the answers will be flawed.
Otherwise your gambling on the luck of random timing luck of who sees your post and happens to understand the issue and are interested in it ;). Those are some bad odds not a good longterm approach.
trying to do the opposite of this
Since there’s no NOT-contains when your not able to use boolean comparison because “contains” is being used then roughly you need to invert any inclusion/exclusion logic; swapping ifs for unless’s and vice versa.
psuedo logic: if true skip this item in loop => unless true dont skip item ==> if not true continue( skip item )
{% assign tag_prefix = 'special_prefix' %}
{% for tag in tags %}
{% unless tag contains tag_prefix %} {% continue %} {% endunless %}
...
{% endif %}
Or set an intermediary variable to a boolean true|false, which you can then use standard boolean logic on it in an if tag, (!= aka not equals).
{% assign tag_prefix = 'special_prefix' %}
{% for tag in tags %}
{% if tag contains tag_prefix %} {% assign show_tag == true %} {% endif %}
{% if show_tag != true %} {% continue %} {% endunless %}
...
{% endif %}
or a known string value, or object, that can also be compared with boolean conditions
{% assign tag_prefix = 'special_prefix' %}
{% for tag in tags %}
{% if tag contains tag_prefix %} {% assign show_tag == "show" %} {% endif %}
{% if show_tag != "show" %} {% continue %} {% endunless %}
...
{% endif %}
That should get you started without seeing any of your existing code.
Also search forum posts for hiding tags using the underscore prefix convention for many similar discussions on tag exclusion techniques.