Shopify Liquid Development

Shopify Metafields and Metaobjects: A Practical Guide

Shopify metafields and metaobjects explained: when to use each, how to read them in Liquid, connect them in the theme editor and model size charts and FAQs.

Editor-style illustration of Shopify metafields and metaobjects feeding structured product data into a theme layout

Quick answer

Shopify metafields add a single custom field, such as fabric or care instructions, to an existing resource like a product. Metaobjects are standalone records with several fields, such as a size chart or testimonial, that many products or pages can reference. Use metafields for one-off attributes and metaobjects for reusable content.

Key takeaways

  • Use a metafield when you need one extra attribute on a product, collection, customer or order; use a metaobject when the content has several fields or is reused.
  • In Liquid, always read the stored value with .value and check it against blank before rendering, because a missing metafield still returns an object.
  • Connect metafields and metaobject fields to section settings with dynamic sources so editors never touch code.
  • Define the data model first, with clear names, field types and validations, before you build the section that displays it.
  • Metaobjects can be drafts or active, and a draft returns nil in Liquid, so check the status when content does not appear.
On this page
  1. What are Shopify metafields and metaobjects?
  2. When should you use a metafield and when a metaobject?
  3. How do you read metafields in Liquid?
  4. How do you read metaobjects in Liquid?
  5. How do dynamic sources connect data to the theme editor?
  6. How do you plan a data model? A step-by-step process
  7. What are the most common mistakes?
  8. What can Indian D2C brands do with structured data?
  9. How Arham Technology approaches Shopify metafields and metaobjects
  10. Next step

Most Shopify stores outgrow the default product page quickly. You need a fabric and care block, a size chart that differs by category, a "what's in the box" list, or a testimonial strip reused across pages. Pasting that content into product descriptions makes it hard to style, translate or reuse.

Shopify metafields and metaobjects are the built-in way to store that content as structured data. This guide explains what each one is, how to read them in Liquid, how to connect them to the theme editor and how to plan a data model before development starts.

What are Shopify metafields and metaobjects?

Metafields are custom fields that add a single value to an existing Shopify resource, and metaobjects are standalone records with several fields that you define yourself. Shopify's documentation describes metafields as extra fields on resources such as products, orders and customers, and metaobjects as entirely new types of structured data that can be referenced and reused across your store.

The easiest mental model comes from Shopify's data modelling guide, which compares them to a database. A built-in resource such as Product is a table. A metafield is a new column on that table. A metaobject definition is a brand-new table, and each metaobject entry is a row in it.

When should you use a metafield and when a metaobject?

Use a metafield for one attribute that belongs to one resource, and use a metaobject when the content has several fields or is shared across resources. If you are unsure, ask whether two products would ever need the same block of content.

Content Better choice Why
Fabric, material or "Made in India" label Metafield A single value on each product
Care instructions for one product Metafield One rich text value
Size chart with a title, image and rows Metaobject Several fields reused across many products
Testimonial with name, city, photo and quote Metaobject Multi-field record shown on several pages
Brand or maker profile Metaobject Referenced by many products
Delivery note for a collection Metafield One value on the collection

A hybrid is common. A product gets a metafield of type metaobject reference that points to one size chart entry. Edit the chart once and every linked product updates.

How do you read metafields in Liquid?

You read a metafield in Liquid with resource.metafields.namespace.key and then append .value to output the stored content. According to Shopify's metafield Liquid reference, the namespace groups metafields to prevent conflicts, the key names the field, and the expression returns a metafield object, not the raw value.

Two details save a lot of debugging time:

  • Check the value, not the object. Accessing a metafield always returns an object, even when nothing is stored. Test product.metafields.custom.fabric.value != blank before printing a heading.
  • Watch reserved key names. If a key is called size, first or last, use bracket notation such as product.metafields.custom["size"], because those words are also built-in Liquid filters.

Metafields cannot be created in Liquid. Definitions and values come from the Shopify admin, an app or the API, and your theme only reads them. For formatting, filters such as metafield_tag render a value according to its type, which is handy for rich text, dates and file references.

How do you read metaobjects in Liquid?

You read a metaobject by its type and handle, using metaobjects.type.handle, and then reach each field by its key. Shopify's metaobject Liquid reference shows examples such as metaobjects.testimonials.homepage.title, and square brackets work too.

You can also loop over all entries of a type with metaobjects.testimonials.values, which is how a testimonial or FAQ section is usually built. Older themes may still use shop.metaobjects, but Shopify's changelog says that form is deprecated in favour of metaobjects.

If you enable the publishable capability, entries have a draft or active status. A draft returns nil in Liquid, so a missing block is often an unpublished entry rather than a code error.

How do dynamic sources connect data to the theme editor?

Dynamic sources let merchants connect a section or block setting to a metafield or metaobject field from inside the theme editor, with no code. Shopify's documentation on dynamic sources says compatible settings show a connect icon, and the available fields depend on the setting type.

Some examples from that documentation: an image_picker setting can connect to a file reference metafield, a product setting to a product reference, and a color setting to a color metafield. A richtext setting can connect to text-based metafields. A setting's type has to match the metafield's type, so plan both together.

This is where metafields and custom Shopify sections work well as a pair. The developer builds the section schema once, and the marketing team points each setting at the right data per product. Only use a dynamic source as a default value in contexts where the data exists, such as a product-related value in a section on a product template.

How do you plan a data model? A step-by-step process

Planning the data model first prevents the most expensive Shopify theme rework, which is renaming fields after hundreds of products are filled in.

  1. List the content blocks your pages need, such as fabric details, size chart, FAQs and testimonials.
  2. Decide metafield or metaobject for each block using the table above.
  3. Name things consistently. Use readable names in the admin and stable, lowercase keys in code.
  4. Choose field types carefully. Use rich text for formatted copy, file references for images, and list types for repeating values. Add validations such as required fields or character limits.
  5. Set access rules. Decide who can edit values in the Shopify admin. Storefront API access matters only if you run a headless storefront, because Liquid themes can read the data either way.
  6. Build the section or snippet that renders each block, with an empty-state check.
  7. Fill sample data for a few products and test on mobile, long text and missing values.
  8. Document the model so future developers and the content team know what each field is for.

Bulk filling is the slow part of a catalogue project. Plan a CSV import or a small script for large catalogues and give editors a checklist of fields to complete.

What are the most common mistakes?

The most common mistakes are structural, not technical:

  • Storing structured data as one long text field, which makes it impossible to restyle or reuse.
  • Using metafields where a metaobject fits, so the same size chart is copied into hundreds of products.
  • Forgetting empty states, which leaves blank headings on pages where a field was not filled in.
  • Leaving entries in draft and wondering why the section does not render.
  • Changing key names after launch, which silently breaks Liquid that references the old key.
  • Stacking apps for features structured data could handle, which adds scripts and monthly fees. Our Shopify Liquid development guide covers this app bloat problem in more detail.

What can Indian D2C brands do with structured data?

Indian D2C brands can use structured data for the details shoppers ask about before buying. Examples include fabric and wash-care blocks for apparel, ingredient and usage lists for beauty and wellness products, regional size charts, and delivery or COD notes by product type.

Metaobjects also suit trust content: certification badges, press mentions and customer stories with a city and photo. Keep claims accurate, and make sure statements about ingredients, certifications or delivery match your actual policies and any rules that apply to your product category.

Structured data also supports speed. Pulling content from native fields is lighter than adding a page-builder app, which helps your Core Web Vitals and technical SEO.

How Arham Technology approaches Shopify metafields and metaobjects

Our Shopify Liquid development service treats the content model as part of the theme work. The steps look like this:

  • Theme audit: we review the active theme, current apps and where content is hard-coded.
  • Section spec: we define settings, blocks and the metafield or metaobject model so marketing can self-serve.
  • Development theme build: we write the Liquid on a duplicate theme, run Theme Check and test across templates.
  • Merchant preview: your editors fill real products and campaign content and flag friction.
  • Publish and guardrails: we document the fields, leave rollback notes and monitor storefront health.

Deliverables typically include metafield-driven content for product pages, Online Store 2.0 sections with schema settings, reusable snippets and theme clean-up. If you are building or replatforming a store, our Shopify development service covers the wider project, and the Shopify store development cost guide explains where theme and data work sit in a budget.

Next step

If your product pages repeat the same blocks by hand, or marketing waits on developers for every content change, send us a short brief through the contact page. We will review your catalogue, propose a data model and give you a delivery estimate. You can also read more about our Shopify Liquid development service first.

Frequently asked questions

What is the difference between a metafield and a metaobject in Shopify?

A metafield is a single custom value attached to an existing Shopify resource such as a product or customer. A metaobject is a standalone entry with several related fields, defined by its own schema, that can be referenced from many products or pages. Think of metafields as extra columns and metaobjects as new tables.

How do I show a metafield in a Shopify theme?

In Liquid, access it as resource.metafields.namespace.key and append .value to output the stored value, for example product.metafields.custom.instructions.value. Wrap it in a check against blank so the heading does not appear when the field is empty. Merchants can also connect it through a dynamic source in the theme editor.

Can I create metafields with Liquid?

No. Shopify's Liquid reference states that you cannot create metafields in Liquid. You create definitions and values in the Shopify admin or through an app or the Admin API, and Liquid only reads them when the page renders.

Why is my metaobject not showing on the storefront?

The most common cause is status. When the publishable capability is on, a metaobject is only accessible in Liquid if its status is active, and a draft returns nil. Also check that you used the correct type and handle, and that the entry actually has the field value you expect.

Do I need an app to use metafields and metaobjects?

No. Merchants can define and edit metafields and metaobjects in the Shopify admin and display them with a theme that supports dynamic sources, or with custom Liquid. Apps and developers become useful when you need bulk imports, validation rules or a more complex data model.

NEXT STEP

Want Shopify Liquid Development done right?

Get a free consultation and a clear plan โ€” scope, timeline and cost โ€” from our Mumbai team.

Get a free consultation โ†’See Shopify Liquid Development