Skip to content

What Are Metafields in Shopify?

Definition

Metafields are custom fields that store extra data on Shopify resources such as products, variants, collections, customers and orders. Each metafield has a namespace and key, a type and a value. A metafield definition sets the type and validation rules, so the data can be edited in the admin and shown in the theme.

How metafields work

Every Shopify resource has a fixed set of fields. A product has a title, description, price, images and variants, but nothing for "material" or "care instructions". Metafields add custom data to any Shopify resource, such as products, variants, collections, customers and orders[1]. Shopify's own example is an apparel store that wants care instructions for each product, shown in its own section of the product page[2].

Each metafield has four parts[1]:

  • Namespace and key: together they identify the field, for example custom.care_instructions. The namespace groups fields and prevents naming conflicts, for instance between two apps.
  • Type: what kind of value it holds (text, number, date, reference and so on) and how Shopify interprets it.
  • Value: the data itself, different for every product.
  • Owner: the resource it belongs to, and whether the merchant or an app controls it.

Before you add values, you create a metafield definition: the schema that tells Shopify the field's name, type and rules. Definitions give you type validation, an input field in the Shopify admin, filtering in queries and control over whether the Storefront API can read the field for headless storefronts[1]. A metafield without a definition still stores data, but it has no validation and is harder for staff to edit.

Metafield types

The type decides what the admin shows when staff enter a value and what Liquid gets back. The main groups are[3]:

GroupTypesTypical use
Textsingle_line_text_field, multi_line_text_field, rich_text_field, url, colorMaterial, care instructions, a short note
Numbers and true/falsenumber_integer, number_decimal, booleanPack size, "vegan" yes or no
Datesdate, date_timeLaunch date, best-before date
Measurementsweight, dimension, volume, ratingHeel height, bottle volume
Money and JSONmoney, jsonA deposit amount, structured data for developers
Referencesproduct_reference, variant_reference, collection_reference, file_reference, metaobject_reference and moreRelated products, a PDF manual, a size chart

Most types also come as a list, such as list.product_reference, so one field can hold several values. Rich text, JSON, money and true/false have no list version[3].

The limits are generous: merchants can create up to 256 definitions per resource type, and each app can create its own 256. Most values can be up to 64 KB, and a list holds up to 128 items, or 1,024 for metaobject references[4].

Where metafields show up in a theme

A metafield is invisible to shoppers until the theme displays it. There are two ways to do that.

In the theme editor, without code. Sections and blocks that support dynamic sources can be connected to a metafield: you pick a text block, click the dynamic source icon and choose the field[5]. Every product page then shows that product's own value.

In Liquid. A developer reads the field as product.metafields.namespace.key and outputs its value. Reference types return full objects, so a list.product_reference gives you products you can loop through. Liquid can only read metafields; values are created in the admin or by an app[6].

{% if product.metafields.custom.material %}
  <p>Material: {{ product.metafields.custom.material.value }}</p>
{% endif %}

{% for item in product.metafields.custom.complete_the_look.value %}
  <a href="{{ item.url }}">{{ item.title }}</a>
{% endfor %}

Metafields can also power storefront filters. Product and variant metafields of type single line text, decimal, integer, true or false and metaobject reference can become filters, within a store-wide maximum of 25 filters[7].

Example: product data for a shoe store

Take a hypothetical shoe store with 300 products. Today the material, heel height and care instructions are typed into each product description, and the size chart is an image pasted into all 300 descriptions. We would replace that with five product metafield definitions:

DefinitionTypeShown where
custom.materialSingle line textProduct page and a "Material" filter on collections
custom.heel_heightDimensionProduct specifications block
custom.care_instructionsMulti-line textA collapsible tab on the product page
custom.size_chartMetaobject referenceA size chart pop-up
custom.complete_the_lookList of product referencesA "Complete the look" row

Five definitions out of an allowed 256 per resource type[4], 300 products, so 1,500 values at most, filled in once by bulk edit. The size chart becomes a single metaobject entry that all 300 products reference, so a change to the chart is one edit instead of 300. Because material is a single line text field, it qualifies as a storefront filter[7].

Metafields vs metaobjects

Shopify's own analogy: metafields add new columns to existing resources, while metaobjects create entirely new kinds of data, like custom tables[8].

MetafieldsMetaobjects
What it isAn extra field on a product, customer, order or other resourceA standalone entry with its own fields
Use it forAn attribute of one resource, such as materialA reusable entity, such as a size chart or a designer profile
ReuseOne value per resourceOne entry referenced from many resources
How they connectA metafield can reference a metaobjectUsually reached through a metafield

FAQ

What is the difference between a metafield and a metafield definition?

The definition is the schema: name, namespace and key, type and validation rules. The metafield is the value stored on a specific product or other resource. Create the definition first, so the admin shows a proper input and validates every value[1].

Can customers see metafields?

Only if the theme displays them. You connect a metafield to a section or block in the theme editor, or a developer outputs it in Liquid. Until then the data exists only in the admin[5].

How many metafields can I create?

Up to 256 metafield definitions per resource type for the merchant, and another 256 for each installed app. Most single values can be up to 64 KB[4].

Can I filter products by metafields?

Yes. Product and variant metafields of type single line text, decimal, integer, true or false and metaobject reference can be storefront filters, up to 25 filters per store in total[7].

Do I need a developer to use metafields?

Not always. Creating definitions, entering values and connecting them to theme blocks that support dynamic sources needs no code[5]. You need a developer for types your theme doesn't support or for custom layouts, such as a size chart pop-up.

The bottom line

Metafields let you store the product, customer and order data that Shopify does not have a built-in field for. Define each field once, with the right type, and the admin validates every value and the theme can show it on every page. Use metaobjects for things many products share. When the theme needs custom blocks to show that data, our Shopify theme development team builds them, and our overview of Online Store 2.0 features explains how dynamic sources fit into a modern theme.

Article sources

We use primary sources only: official documentation, product pages and laws. Each link was checked on the date shown.

  1. Shopify. About metafields. Accessed 17th Nov 2026.
  2. Shopify Help Center. Metafields. Accessed 17th Nov 2026.
  3. Shopify. List of data types. Accessed 17th Nov 2026.
  4. Shopify. Metafield limits. Accessed 17th Nov 2026.
  5. Shopify Help Center. Displaying metafields on your online store. Accessed 17th Nov 2026.
  6. Shopify. Liquid objects: metafield. Accessed 17th Nov 2026.
  7. Shopify Help Center. Storefront filters (Shopify Search & Discovery). Accessed 17th Nov 2026.
  8. Shopify. Data modeling with metafields and metaobjects. Accessed 17th Nov 2026.

Need this on your store?

See the service

The checklist we run before touching a client's code

Get it by email, plus a few short notes over the next two weeks: what we see most often on Shopify stores and what actually fixes it.

No spam. Unsubscribe anytime. Privacy Policy