Skip to content
All posts

How to filter Shopify collections by metafield

Two illustrated figures sort a pile of mixed beads: one sifts a jumbled bowl, the other files them into neat tray lanes.

By Hidayat Sagita Published 3 min read

Summarize with AI

Shopify's Search & Discovery app can filter a collection by a metafield, an extra field you add to your products, such as fabric, fit or season. You create the field, fill it in and add it as a filter. Metafield filters share Shopify's limits: 25 filters per store, 100 values per filter, and no filters on a collection over 5,000 products.

You have filled in fabric, fit, season and care on every product. Your collection page still offers only size and price, so a shopper after a slim linen shirt scrolls through 400 products to find three. The fields exist. The filters do not.

How do you filter a Shopify collection by a metafield?

You turn the field into a filter in Search & Discovery, Shopify's free app for filters and search.

  1. Add the field. Open a product, find the Metafields section and click Add definition to create the field. Name it and pick a type. Text, whole numbers, decimals and true or false all work, and so does a reference to a reusable entry, which is how colors and images work. Pick the list version when one product can hold several values, such as two seasons.
  2. Fill it in. Enter the value on each product it applies to. The Bulk Editor changes many products at once, and how to use the Shopify bulk editor shows where a field's column sits.
  3. Add the filter. Go to Apps, then Search & Discovery, then Filters, and click Add filter. Choose your field in the Source box. It lists fields by where they live: on every product, on products in one category, or on each variant. Rename the filter if shoppers use another word, then click Save.
  4. Check the collection. Only values that exist on that collection's products appear, so a collection with no linen shirts does not list linen.

Shopify also fills in category fields for you. Give a product a category and standard fields such as Color appear in the same Source list.

Which limits will a metafield filter run into?

A metafield filter shares the limits Shopify sets on every filter:

  • 25 filters per store, standard and custom together, so each metafield filter spends one.
  • 100 values shown per filter. Anything past 100 is not displayed.
  • No filters on a collection with more than 5,000 products, or on a search with more than 100,000 results.

Metafield filters carry one more catch. Shopify notes that they can show fewer values than the field holds, because the app checks only a limited number of metafields for unique values, and some values go missing depending on how the field is set up.

Two fixes cost nothing. Group similar values: select them, click Create group, name it and save, so Navy, Dark Blue and Midnight read as one Blue. On standard attributes such as Color, Shopify sets the groups from its own taxonomy, and you can rename a group but not change its members. And when you want tight control, make the field a text list that holds only the values you want shown. Every limit, with what to do at each, is in Shopify filter limits.

When does an app make sense for metafield filters?

When your catalog needs more than 25 filters, when you want to choose which values belong together on standard attributes too, or when you want swatches loaded in bulk from a file.

Sledge builds product filters from any metafield, plus tags, variant options, vendor and price, as many as your catalog needs. Each plan covers a catalog size, so check yours against your product count.

You choose which values belong together. Navy, Dark Blue and Midnight collapse into one Blue, variant titles included, so a shopper hunting blue sees forty products, not the four under one spelling.

Colors and patterns become swatches. You fill in a CSV file once, with a sample to copy, and import it, with no editing of each product. More on that in color swatches on collection pages.

Sledge switches on from App embeds in the theme editor and never edits your theme files, so removing it leaves your theme as it was.

The metafield filter checklist

  • Each attribute shoppers choose by exists as a field and is filled in on every product it applies to.
  • Each field is added as a filter in Search & Discovery, and the store stays under 25 filters.
  • No filter holds more than 100 values, and similar values are grouped.
  • No collection has passed 5,000 products.
  • Colors and patterns are swatches built from a color or image entry, not plain text.
  • The filters are checked on a collection page and on a search results page.

FAQ

Questions, answered

  • 14-day free trial

    Explore Sledge on your store before you decide to commit.

  • No credit card required

    Start improving your store with no upfront commitment.

  • Setup in minutes

    Get Sledge running without a lengthy setup process.

  • Built to grow sales

    Turn shopper behavior into actions that help you sell more.

Can you filter a Shopify collection by a metafield?

Yes. Search & Discovery builds filters from product, variant and category metafields, the last being the fields Shopify fills in when you give a product a category. The field can be text, a whole number, a decimal, true or false, or a reference to a reusable entry such as a color, and text and reference fields can hold lists. Add it under Apps, Search & Discovery, Filters, Add filter.

How many metafield filters can you add?

Metafield filters share Shopify's limit of 25 filters per store with every other filter, and one filter shows at most 100 values. A collection with more than 5,000 products shows no filters at all.

Why are some values missing from my metafield filter?

Shopify says a metafield filter can show fewer values than the field holds, because the app checks only a limited number of metafields for unique values and some values go missing depending on how the field is set up. A filter also shows at most 100 values. Group similar values, or build the filter from a text list that holds only the values you want shown.

Can you show color swatches on collection pages without coding?

Yes. Shopify shows swatches when the filter is built on a color or image entry, such as its standard Color attribute or a reusable entry you create, and the theme supports them, as current versions of Dawn do. In the filter's settings, choose Include swatch for a standard attribute, or Include visual for a field of your own. Sledge adds color and image swatches from a CSV file, with a sample file to fill in.

Let shoppers tell you exactly what they want.

Install free. Build a filter from every metafield you have, add the swatches, and watch a wall of 400 products turn into a path to a purchase. On a paid plan, built-in Growth Intelligence shows what your store is leaking, in dollars.