How to programmatically filter out/hide products and collections?

I need to build a custom app that hides products and or collections from being rendered on the storefront based on certain criteria. I’m new to the Shopify ecosystem and I’m struggling to figure out how this would work coming from WordPress where this is easily achievable.

I’m guessing I should use app extensions? I don’t want to provide my own output because obviously I’d like the app to be compatible with as many themes as possible so I would just like to filter the products.

Does anybody have any suggestions? Thank you

I dont think there is very good solutions to this, other than handling it through collection population, as other apps/extensions rely a lot on this.

You can programatically skips items with liquid, but it will ruin the pagination and filtering through Search & Discovery.

Custom filter/sort apps does what you’re looking for, but they also give you a new filtering and pagination system (which is not really recommended anymore).


The above is my two scents as, primarily, a theme developer - so if you find a solution to remove products/collections from native arrays to be able to skip them in the storefront even through they’re in the Collection resource; I’m all ears :blush:

Can I ask what the usecase for this app is? A client request or simply trying to find an app idea?

Hi @curzey thanks for your reply and insights! Those are exactly the issues I’d like to avoid. Appreciate your perspective as a theme developer!

We’re building a custom app and one of the functionalities required by the app is the ability to hide and protect access to certain products based on certain criteria. So far this seems to be the main roadblock.

I’m not sure of the best way to get there - generally I’ve achieved cases like that before using the seo.hidden metafield, few liquid hacks and generally keeping those products out of the used collections. Could be a metafield or tag identifier - depends on the project. Those can also be automatically populated.

1 Like