Back to resources

Guide

How to Filter Shopify Products by Metafield

Learn how to create Shopify metafield filters for products, variants, collections, and search results, with setup steps and troubleshooting fixes.

Hyper Team
8 min read
How to Filter Shopify Products by Metafield

Shopify lets you filter products by metafield in two different places: inside the Shopify Admin product list and on customer-facing collection and search pages.

To create a storefront metafield filter, you first create a product or variant metafield definition, add values to the relevant products, and then select that metafield under Apps → Shopify Search & Discovery → Filters.

This guide explains how to set up a Shopify filter by metafield, which metafield types are supported, how product and variant filters differ, how filter URL parameters work, and what to check when a metafield filter does not appear.

Quick answer: Create a product or variant metafield definition, populate it across your catalog, open Shopify Search & Discovery, select Filters → Add filter, and choose the metafield as the filter source. Your active theme must support storefront filtering for customers to see it.


What Does "Shopify Filter by Metafield" Mean?

The phrase "Shopify filter by metafield" can refer to two different features.

Filtering products inside Shopify Admin

Admin filtering helps merchants find and manage products based on custom product data.

For example, a furniture merchant could create a metafield named Room and then filter the Shopify product list to display only products with the value Living room.

This type of filter is visible to store administrators. Customers do not see it on the storefront.

Filtering products on collection and search pages

Storefront filtering lets customers refine the products displayed on collection and search-result pages.

For example, shoppers could filter a clothing collection by:

  • Fabric
  • Fit
  • Occasion
  • Country of origin
  • Sustainability certification
  • Care method

These attributes might not exist as standard Shopify product fields, so metafields provide a structured way to store and filter them.

Shopify supports storefront filters based on standard product data, product options, product metafields, variant metafields, category metafields, and compatible metaobjects.


Before You Create a Shopify Metafield Filter

A working metafield filter requires more than simply adding custom information to one product.

Before starting, confirm that you have:

  • Created a metafield definition.
  • Chosen whether the metafield applies to products or variants.
  • Selected a metafield type supported by storefront filtering.
  • Added values to the relevant products or variants.
  • Added the metafield as a filter source in Search & Discovery.
  • Confirmed that your theme supports Shopify storefront filters.

Metafield definitions are especially important. A definition establishes the metafield's name, namespace, key, value type, validation rules, and the Shopify resource to which it belongs.

For example, a product material metafield might use:

FieldValue
NameMaterial
Namespace and keycustom.material
TypeSingle line text
OwnerProduct

Shopify requires metafield definitions before the values can be consistently managed and used across products.


How to Create a Shopify Product Metafield

Follow these steps to create the metafield that will become your filter.

Step 1: Open metafield settings

From Shopify Admin, go to:

Settings → Metafields and metaobjects

Select Products if the value applies to the entire product.

Select Variants if each variant can have a different value.

For example:

  • Product metafield: furniture style
  • Variant metafield: fabric finish
  • Product metafield: country of origin
  • Variant metafield: storage capacity

Step 2: Add a definition

Click Add definition and enter a clear name.

For this example, use: Material

Shopify automatically suggests a namespace and key, such as: custom.material

You can edit this identifier before saving, but it should remain descriptive and consistent.

Step 3: Choose a metafield type

For a standard material filter, select Single line text.

Use a list when one product can legitimately belong to several filter values.

For example, a blended garment might need:

  • Cotton
  • Linen
  • Viscose

In that situation, use a single-line text metafield that accepts a list of values.

Step 4: Add validation where useful

Validation rules reduce inconsistent data.

For example, instead of allowing staff to enter any material name, you could restrict the accepted choices to:

  • Cotton
  • Linen
  • Leather
  • Polyester
  • Silk
  • Wool

Controlled values help prevent separate filter options such as:

  • Cotton
  • cotton
  • 100% Cotton
  • Cotton Fabric

Without standardization, Shopify may treat these as separate values.

Step 5: Save the definition

Save the metafield definition and confirm that it is available on product pages.

Shopify also allows metafield definitions to be created from an individual product's Metafields section by selecting Add definition.


How to Add Metafield Values to Products

After creating the definition, add a value to every product that should be included in the filter.

Add a value to an individual product

  1. Go to Products.
  2. Open a product.
  3. Scroll to the Metafields section.
  4. Find the new metafield.
  5. Enter or select a value.
  6. Click Save.

For example:

FieldValue
ProductClassic Dining Chair
MaterialOak

Add values in bulk

For larger catalogs, use Shopify's bulk editor.

  1. Open Products.
  2. Select the products you want to update.
  3. Click Bulk edit.
  4. Add the metafield as a column.
  5. Enter or select values for each product.
  6. Save your changes.

Using the bulk editor is safer and faster than opening hundreds of products individually. Shopify specifically recommends it for updating metafields across a catalog.


How to Filter Products by Metafield in Shopify Admin

You can use metafields to search and organize products internally without exposing the filter to customers.

First, make sure the metafield definition has Use as filter in admin enabled.

Then:

  1. Open Products in Shopify Admin.
  2. Click the search and filter field.
  3. Add a metafield filter.
  4. Select the metafield.
  5. Choose an operator and value.
  6. Apply the filter.
  7. Optionally save the filtered results as a product view.

You can also search by metafield using Shopify's product-query syntax.

For a metafield with the namespace and key custom.material, search for products where the value is silk with:

metafields.custom.material:silk

Shopify documents the query format as:

metafields.namespace.key:value

Filtering must be enabled on the definition before Shopify can reliably query that metafield.


How to Add a Metafield Filter to Shopify Collections

Creating and populating a metafield does not automatically display it on your storefront.

You must also add it through Shopify Search & Discovery.

Step 1: Open Search & Discovery

From Shopify Admin, go to:

Apps → Search & Discovery

Step 2: Open the filter settings

Click Filters, followed by Add filter.

Step 3: Choose the metafield source

Click the Source field.

Shopify organizes metafield sources into categories such as:

  • Product metafields
  • Variant metafields
  • Category metafields

Select the metafield definition you created.

For example: Product metafield: Material

Step 4: Choose the customer-facing label

You can rename the filter without changing the underlying metafield.

For example, an internal metafield called Primary construction material could be displayed to shoppers as Material.

Use language customers understand. Avoid internal catalog terminology.

Step 5: Configure filter behavior

Depending on the source, Shopify may let you configure:

  • Filter-value sorting
  • Grouped values
  • AND or OR behavior
  • Empty-value handling
  • Visual presentation
  • Swatches or images for compatible metaobject filters

By default, values selected from different filters use AND logic.

For example:

Material: Cotton AND Size: Medium

returns products that are both cotton and available in medium.

Multiple values chosen from the same filter normally use OR logic.

For example:

Material: Cotton OR Linen

returns products matching either value.

Step 6: Save and test

Save the filter and open a relevant collection page.

Test it on:

  • Desktop
  • Mobile
  • Search results
  • Small collections
  • Large collections
  • Products with multiple values
  • Products with no value
  • Out-of-stock products

Shopify currently permits up to 25 active filters and lets merchants reorder, rename, group, and sort filter values inside Search & Discovery.


Supported Shopify Metafield Filter Types

Not every metafield type can be used as a storefront filter.

Metafield typeSupported as a storefront filter?Example
Single-line textYesMaterial
Single-line text listYesCompatible devices
IntegerYesNumber of shelves
DecimalYesThickness
True or falseYesWaterproof
Metaobject referenceYesFabric type
Metaobject reference listYesProduct features
Multi-line textNoLong care instructions
Rich textNoDetailed product story
FileNoProduct manual
URLNoManufacturer website

For a filter such as material, style, compatibility, room, or product use, single-line text usually works well.

For a product that can have several values, use a list.

For visually rich values such as colors, patterns, or materials with images, a metaobject reference can provide more control. Shopify can use compatible metaobject-based filters to display text, swatches, or images when the theme supports the required filter-value API.


Product Metafield vs Variant Metafield Filters

Choosing the correct owner is important.

Product metafieldVariant metafield
Applies to the whole productApplies to an individual variant
Suitable for material, style, use case, or product familySuitable for finish, storage, dimensions, or variant-specific fabric
Uses product-level filteringUses variant-level filtering
URL scope begins with filter.pURL scope begins with filter.v

Use a product metafield when:

  • Every variant shares the same value.
  • The attribute describes the product as a whole.
  • Customers should see the same filter value regardless of variant.

Examples include:

  • Country of origin
  • Furniture style
  • Product compatibility
  • Primary material
  • Intended room
  • Sustainability certification

Use a variant metafield when:

  • Different variants have different values.
  • The filter should narrow results to a specific variant attribute.
  • The attribute is more detailed than a standard product option.

Examples include:

  • Variant fabric
  • Finish
  • Storage capacity
  • Technical rating
  • Variant dimensions
  • Packaging quantity

Do not create a product metafield when the value genuinely changes between variants. That can produce inaccurate filter results.


Shopify Metafield Filter URL Parameters

When a customer applies a storefront filter, Shopify adds filter parameters to the collection or search-result URL.

The general product-metafield structure is:

filter.p.m.namespace.key=value

For example:

filter.p.m.custom.made_in=canada

The parts mean:

ComponentMeaning
filterShopify's filter parameter namespace
pProduct-level scope
mMetafield attribute
customMetafield namespace
made_inMetafield key
canadaSelected value

A variant metafield uses the v scope:

filter.v.m.custom.fabric=leather

A complete collection URL might contain:

/collections/all?filter.p.m.custom.made_in=canada

Shopify applies different filters with AND logic. Multiple values within the same filter can be included using repeated parameters or comma-separated values, depending on the filter.

A filter must be created in Shopify Admin before its URL parameter can be applied correctly. Manually adding a parameter does not replace the metafield definition or Search & Discovery configuration.


Why Is My Shopify Metafield Filter Not Showing?

A missing filter is usually caused by its definition, values, source configuration, theme support, or Shopify's display limits.

The metafield does not have a definition

An unstructured metafield might exist on a product without appearing as an available filter source.

Go to: Settings → Metafields and metaobjects

Select Products or Variants and confirm that the namespace and key have a proper definition.

No products have a metafield value

Creating a definition is not enough. Relevant products or variants must have actual values.

For example, a Material filter cannot show useful options when every product's Material metafield is empty.

The metafield uses an unsupported type

Multi-line text, rich text, files, URLs, and several other types cannot be used as standard storefront filters.

For most catalog attributes, use:

  • Single-line text
  • Single-line text list
  • Integer
  • Decimal
  • True or false
  • Supported metaobject references

The wrong owner was selected

A product metafield and variant metafield are separate sources.

If the value was created under Variants, look in the Variant metafields section when selecting the filter source.

The filter was not added in Search & Discovery

Metafields do not automatically become collection filters.

Open: Apps → Search & Discovery → Filters

and add the metafield as a filter source.

The theme does not support Shopify filters

Shopify filters work with compatible themes and custom storefronts that implement the relevant Liquid or Storefront APIs.

You can configure filters in Search & Discovery even when the theme does not support them, but they will not appear to customers.

The current collection has no matching values

Shopify only displays filters and values relevant to the products in the current collection or search result.

A Fabric filter might appear on a clothing collection but disappear on a collection containing only accessories with no fabric metafield values.

Metafield values are inconsistent

The following values may appear as separate options:

  • Cotton
  • cotton
  • 100% cotton
  • Cotton fabric

Standardize capitalization, spelling, spacing, units, and naming conventions before publishing the filter.

The collection contains more than 5,000 products

Shopify does not display native filters on collections containing more than 5,000 products.

Filters are also hidden when a search produces more than 100,000 product results.

The filter has too many values

A storefront filter can display up to 100 filter values.

Search & Discovery might show more values inside the app, but only a limited number can be displayed to shoppers. Group similar values or divide broad attributes into more useful filters when necessary.

The filter is hidden because every result is empty

Shopify can hide empty values or move them to the bottom of the filter list.

Check the empty-value behavior in Search & Discovery settings if expected values are missing.


Shopify Metafield Filter Best Practices

A technically functional filter can still create a poor shopping experience. Use these practices to keep metafield filters useful.

Use customer language

A customer should immediately understand every filter label and value.

Use Material instead of Primary product composition classification.

Standardize values before launch

Create a controlled naming system for:

  • Capitalization
  • Singular and plural words
  • Measurements
  • Abbreviations
  • Colors
  • Materials
  • Technical specifications

Choose one form and use it consistently.

For example, 10 cm should not be mixed with 10cm, 100 mm, or 0.1 m unless those values are intentionally different.

Avoid creating filters with hundreds of values

A filter containing hundreds of model numbers or minor attributes can make browsing harder.

Use metafield filters for attributes that meaningfully help customers narrow their options.

Use lists carefully

A list is appropriate when a product genuinely belongs to multiple values.

For example, a laptop sleeve could support:

  • 13-inch MacBook Air
  • 13-inch MacBook Pro
  • 14-inch MacBook Pro

A single-value metafield would not represent this accurately.

Choose product and variant scope carefully

Use product metafields for shared attributes and variant metafields for variant-specific data.

Changing the scope after populating a large catalog can require substantial cleanup.

Use clear descriptions for staff

Add an internal description to every metafield definition.

For example:

Select the product's primary material. Use only approved values. Do not enter percentages or supplier-specific material codes.

This reduces data errors when several team members manage products.

Test real combinations

Do not test only one filter at a time.

Test combinations such as:

  • Material: Cotton
  • Size: Medium
  • Availability: In stock

Make sure the results match what a customer would expect.

Review mobile usability

On mobile, confirm that:

  • The filter button is easy to find.
  • Active filters are visible.
  • Customers can clear filters.
  • Long value lists remain usable.
  • Applying filters does not cause unexpected layout shifts.
  • The product count updates correctly.

Shopify Search & Discovery vs an Advanced Filter App

Shopify Search & Discovery can work well for stores with straightforward catalog structures and compatible themes.

However, some merchants need additional control over search, filter trees, catalog scale, analytics, and storefront presentation.

RequirementShopify Search & DiscoveryHyper Search & Filter
Basic metafield filtersYesYes
Product and variant filtersYesYes
Collection-page filtersYesYes
Instant search suggestionsNative capabilities varyIncluded
Typo toleranceNative capabilities varyIncluded
Synonym controlsAvailable for search customizationIncluded by plan
Multiple filter treesLimitedIncluded by plan
Filter-usage analyticsLimited native visibilityAvailable on selected plans
Zero-result reportingLimited native visibilityAvailable on selected plans
Real-time product synchronizationShopify-native catalogIncluded
Catalog supportNative limits applyPlans support larger catalogs

Hyper Search & Filter lets merchants build filters from attributes including collections, vendors, variants, sizes, colors, prices, tags, and metafields. It also includes instant search suggestions, typo tolerance, synonyms, real-time product synchronization, search-query reporting, and filter analytics.

Shopify's App Store listing states that Hyper Search & Filter supports metafield filtering alongside collection, vendor, variant, size, and color filters. It also lists instant search, AI search, typo tolerance, search suggestions, and analytics capabilities.

When should you consider an advanced filter app?

An advanced Shopify search and filter app may be useful when:

  • Your catalog has many product attributes.
  • Different collections require different filter structures.
  • You need deeper control over collection-page filters.
  • Customers frequently use alternative terminology.
  • Misspelled searches produce poor results.
  • You need search-query or filter-usage analytics.
  • You want to identify zero-result searches.
  • You need additional storefront customization.
  • Your product catalog exceeds the practical limits of native filtering.

The goal is not to add as many filters as possible. The goal is to help customers reach a relevant group of products with fewer decisions.


Frequently Asked Questions

Can you filter Shopify products by metafield?

Yes. Shopify supports metafield filtering inside the Admin product list and on customer-facing collection and search pages. The metafield must have a proper definition, values must be assigned to products or variants, and the metafield must use a supported type.

How do I add a metafield to Shopify Search & Discovery?

Create and populate the metafield first. Then open Apps → Search & Discovery → Filters, click Add filter, and choose the product, variant, or category metafield as the source.

Why is my Shopify metafield not appearing as a filter?

Common causes include a missing metafield definition, an unsupported metafield type, empty product values, the wrong product or variant owner, an incompatible theme, or failure to add the source in Search & Discovery.

Can I filter Shopify collections by metafield?

Yes. A compatible Shopify theme can display metafield filters on collection and search-result pages after the metafield is configured in Search & Discovery.

Can Shopify filter by variant metafields?

Yes. Shopify supports variant metafield filters for compatible field types. Variant metafield URL parameters use the filter.v.m structure.

What is the Shopify metafield filter URL format?

A product metafield generally uses:

filter.p.m.namespace.key=value

A variant metafield generally uses:

filter.v.m.namespace.key=value

Which metafield types can be used as storefront filters?

Supported types include single-line text, single-line text lists, decimals, integers, true-or-false values, metaobject references, and metaobject reference lists.

Do all Shopify themes support metafield filters?

No. Your theme must support Shopify storefront filtering. Filters can still be configured in Search & Discovery when a theme is incompatible, but customers will not see them.

How many filters can I add to Shopify?

Shopify currently allows up to 25 active storefront filters. Each storefront filter can display up to 100 values.

Can a product have more than one value in a metafield filter?

Yes. Create a supported metafield list when a product should belong to multiple filter values.


Create More Flexible Shopify Product Filters

A Shopify filter by metafield gives customers a structured way to narrow products using attributes that are specific to your catalog.

For a basic implementation:

  1. Create the correct product or variant metafield definition.
  2. Select a supported data type.
  3. Standardize and populate the values.
  4. Add the metafield through Shopify Search & Discovery.
  5. Test the filter across collections, search results, and mobile devices.
  6. Monitor the experience as your catalog grows.

Shopify's native tools can be sufficient for straightforward metafield filtering. Stores that need more flexible filter trees, advanced search, typo tolerance, synonyms, filter analytics, or greater catalog control can use Hyper Search & Filter to create a more configurable product-discovery experience.

Install Hyper Search & Filter on Shopify →

Continue reading

More practical Shopify resources

View all resources