How can I correctly filter collections by product metafield value?

I am trying to filter collections by the product metafield value. Is there a way to intercept shopify liquid request before it reaches server? I have a filter somewhat working but instead of working as an actual filter, it shows the products that match the criteria and hides the products that do not have a match. As a result, the pagination returns the same number of items as if all of the products are retrieved. If no products on that page match the metafield criteria, it returns a blank page. I understand why it is doing this, I’m just looking for a proper solution.

Hi @CalebV ,

Are you using Section Redering API ?

Have you try out filter param?
It should look like this ?filter.p.[metafield]=[value]
Or just use some 3rd party filter app and setup the metafield filter https://apps.shopify.com/ultimate-search-and-filter-1