---
title: MetafieldFilter - Storefront API
description: |
  Filters products in a collection by matching a specific metafield value. Used by the [`ProductFilter`](/docs/api/storefront/2025-04/input-objects/ProductFilter) input's `productMetafield` and `variantMetafield` fields.

  Supports the following metafield types: `number_integer`, `number_decimal`, `single_line_text_field`, and `boolean`.
api_version: 2025-04
api_name: storefront
type: input-object
api_type: graphql
source_url:
  html: https://shopify.dev/docs/api/storefront/2025-04/input-objects/MetafieldFilter
  md: https://shopify.dev/docs/api/storefront/2025-04/input-objects/MetafieldFilter.md
---

# Metafield​Filter

input\_object

Filters products in a collection by matching a specific metafield value. Used by the [`ProductFilter`](https://shopify.dev/docs/api/storefront/2025-04/input-objects/ProductFilter) input's `productMetafield` and `variantMetafield` fields.

Supports the following metafield types: `number_integer`, `number_decimal`, `single_line_text_field`, and `boolean`.

## Fields

* key

  [String!](https://shopify.dev/docs/api/storefront/2025-04/scalars/String)

  non-null

  The key of the metafield to filter on.

* namespace

  [String!](https://shopify.dev/docs/api/storefront/2025-04/scalars/String)

  non-null

  The namespace of the metafield to filter on.

* value

  [String!](https://shopify.dev/docs/api/storefront/2025-04/scalars/String)

  non-null

  The value of the metafield.

***

## Input objects using this input

* [Product​Filter.productMetafield](https://shopify.dev/docs/api/storefront/2025-04/input-objects/ProductFilter#fields-productMetafield)

  INPUT OBJECT

  The input fields for a filter used to view a subset of products in a collection. By default, the `available` and `price` filters are enabled. Filters are customized with the Shopify Search & Discovery app. Learn more about [customizing storefront filtering](https://help.shopify.com/manual/online-store/themes/customizing-themes/storefront-filters).

* [Product​Filter.variantMetafield](https://shopify.dev/docs/api/storefront/2025-04/input-objects/ProductFilter#fields-variantMetafield)

  INPUT OBJECT

  The input fields for a filter used to view a subset of products in a collection. By default, the `available` and `price` filters are enabled. Filters are customized with the Shopify Search & Discovery app. Learn more about [customizing storefront filtering](https://help.shopify.com/manual/online-store/themes/customizing-themes/storefront-filters).

***

## Map

### Input objects using this input

* [Product​Filter.productMetafield](https://shopify.dev/docs/api/storefront/2025-04/input-objects/ProductFilter#fields-productMetafield)
* [Product​Filter.variantMetafield](https://shopify.dev/docs/api/storefront/2025-04/input-objects/ProductFilter#fields-variantMetafield)