Metafields

Shopify's built-in fields — title, price, description — cover the common cases, but real stores often need extra structured data a product doesn't natively have: a care-instructions field, a "material" attribute, a related-videos list. That's what metafields are for.

Namespace and key

Every metafield is identified by a namespace and a key — the namespace groups related metafields (often per-app or per-feature) and the key names the specific field:

Liquid reading a metafield
{{ product.metafields.custom.care_instructions }}

Here custom is the namespace and care_instructions is the key — both are set up in the Shopify Admin (Settings > Custom data) before a theme can read them.

Metafield types

A metafield has a declared type — single line text, multi-line text, number, boolean, JSON, a reference to another resource (like linking a product to a related blog post), and several more. The type affects both how it's edited in the Admin and how you should treat it in Liquid:

Liquid different types
{{ product.metafields.custom.warranty_years }} years
{% if product.metafields.custom.is_handmade %}
  <span class="badge">Handmade</span>
{% endif %}

List metafields

A metafield can also hold a list of values, which behaves like any other array in Liquid — loop over it directly:

Liquid looping a list metafield
<ul>
{% for material in product.metafields.custom.materials.value %}
  <li>{{ material }}</li>
{% endfor %}
</ul>

Metaobjects

A metafield holds a value; a metaobject is a full custom content type of its own — think of it as a small structured record (an "Author" with a name, bio, and photo, or a "Recipe" with ingredients and steps) that can then be linked to from a metafield reference. Metaobjects are what let a theme define reusable structured content that isn't tied to any single product:

Liquid rendering a metaobject reference
{% assign author = product.metafields.custom.author.value %}
<p>By {{ author.name }}</p>
<p>{{ author.bio }}</p>

Metafields aren't only for products

Collections, customers, orders, and the shop itself can all carry metafields too — a "featured collections" list of metaobject references on the shop, for instance, is a common pattern for building flexible homepage content without hardcoding IDs into a theme.

Note: before Shopify added native metafield support in the Theme Editor, developers relied on separate apps just to expose custom data to merchants — that's largely unnecessary now, since metafield definitions can be made editable directly in product/section settings.