Collection "ALL" + Hide specific type of Product

I want to hide a specific types of product in my collection “all” without destroying my pagination

{% for product in collection.products %}
{% if product.type != ‘type1’ and product.type != ‘type2’%}

{% endif %}
{% endfor %}

any tips
Thanks in advance

Just got a solution

  1. Make a Collection named “All”

  2. In the condition section

Products must match: all conditions

Product type → is not equal to → type

  1. Set the navigation