Hide specific filter from specific collection pages

Hello, I’m looking for a way to hide a specific filter (género) from certain collection pages (menino-2-6-anos, menina-2-6-anos, rapaz-7-12-anos and rapariga-7-12-anos). How can I do this? Thanks!

Hi @PetitFox , Can you kindly share your store link (with the password protected, if any) with us? We will check it and suggest you a solution if possible.

Sure, it’s petitfoxportugal.myshopify.com

1 Like

Hi @PetitFox ,

Step 1: Go to Shopify Admin → Online Store ->Theme → Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above tag:


Here is result:

BSSCommerceHDL_0-1722152837848.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you :heart_eyes:

It worked! But I don’t want to remove it from all the collection pages, only from a few. Is there a way of specifying the collections I don’t want the “género” filter to show?

1 Like

Hi @PetitFox , Which collections do you not want to appear?

1 Like

Menino (2-6 Anos); Menina (2-6 Anos); Rapariga (7-12 Anos) and Rapaz (7-12 Anos)

1 Like

Hi @PetitFox ,

1, Navigate to Online Store > Themes > Edit Code.

2, Locate and open the theme.liquid file.

3, Paste the code snippet provided below right before the closing head tag, then save your changes.


We hope this assists in resolving the issue.

If you find our solution helpful, kindly consider Liking and Marking it as Accepted. Thank you!

Hi @PetitFox , Pls remove my old code and replace this new code:

Step 1: Go to Shopify Admin → Online Store ->Theme → Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above tag:

{% assign full_url = request.host | append: request.path %}
{% if full_url contains 'menino-2-6-anos' or full_url contains 'menina-2-6-anos' or  full_url contains 'rapaz-7-12-anos' or full_url contains 'rapariga-7-12-anos' %}

{% endif %}

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you :heart_eyes:

1 Like

That’s brilliant, it worked! Many thanks

1 Like

@PetitFox , No problem. Have a good day :heart_eyes:

1 Like

Hello again. I updated the theme and it seems this code isn’t working anymore. Could I ask your help once again? Many thanks!