Shopify Development10 min read

Shopify Metafields vs Metaobjects: Structured Content Without an App

Metafields store extra data on existing resources. Metaobjects are custom data types. Together they replace most third-party content apps — here's when and how to use each.

  • Metafields
  • Metaobjects
  • Shopify Development
  • Content Architecture

Before metaobjects, Shopify stores had two options for structured custom content: squeeze it into metafields on products/pages (messy), or use a third-party app like Shogun or Accentuate (expensive, app dependency). Metaobjects changed this — they're Shopify's native custom content types, available without any app.

01Metafields: extra data on existing resources

Metafields attach additional data to existing Shopify resources: products, variants, collections, customers, orders, pages, and more. They're typed (text, number, date, URL, file, JSON, reference) and defined by a namespace and key.

  • Product metafields: care instructions, materials, country of origin, technical specs
  • Variant metafields: size guide URL, fit type, color swatch reference
  • Collection metafields: banner image, featured brand, SEO content blocks
  • Order metafields: delivery date preference, gift message, B2B purchase order number
  • Customer metafields: trade account status, company name, VAT number

02Defining and accessing metafields

graphql
# Create a metafield definition
mutation {
  metafieldDefinitionCreate(definition: {
    namespace: "custom"
    key: "care_instructions"
    name: "Care Instructions"
    type: "multi_line_text_field"
    ownerType: PRODUCT
    visibleToStorefrontApi: true
  }) {
    createdDefinition { id name }
    userErrors { field message }
  }
}

# Access in Liquid
{{ product.metafields.custom.care_instructions.value }}

03Metaobjects: custom data types

Metaobjects are custom structured data types — like a CMS content model. You define a type (e.g. 'Team Member', 'Testimonial', 'FAQ') with fields, then create entries of that type. Entries can be referenced from product metafields, pages, and displayed in your theme.

  • Use case: a 'Testimonial' metaobject with fields for quote, author name, author role, and avatar
  • Use case: a 'Size Guide' metaobject with fields for size chart data, brand, and product category
  • Use case: a 'Team Member' metaobject with name, role, bio, and photo fields
  • Use case: 'FAQ' metaobjects for structured questions and answers, referenced from product pages
graphql
# Create a metaobject definition
mutation {
  metaobjectDefinitionCreate(definition: {
    type: "testimonial"
    name: "Testimonial"
    fieldDefinitions: [
      { key: "quote", name: "Quote", type: "multi_line_text_field", required: true }
      { key: "author_name", name: "Author Name", type: "single_line_text_field", required: true }
      { key: "author_role", name: "Author Role", type: "single_line_text_field" }
      { key: "rating", name: "Rating", type: "rating" }
    ]
  }) {
    metaobjectDefinition { id type }
    userErrors { field message }
  }
}

04Metafields vs Metaobjects: the decision

  • Use metafields when: adding extra data to an existing resource (product, order, customer)
  • Use metaobjects when: creating a new content type that doesn't fit an existing resource
  • Use metaobject references from metafields when: linking reusable structured content to a resource (e.g. a product references a 'Size Guide' metaobject)

05Exposing metaobjects on the storefront

Metaobjects can be queried via the Storefront API and accessed in Liquid via {% for entry in shop.metaobjects.testimonial.values %}. In the theme editor, metaobject reference fields can be exposed as picker inputs — letting your merchandising team select which testimonials appear on each product page.

Metaobjects marked as 'Storefronts API access' are publicly readable without authentication. Don't store sensitive data in metaobjects that have storefront access enabled.

06Replacing content apps with metaobjects

Most stores using page builders or content apps (Shogun, PageFly) for structured product content can replace these with metaobjects and custom sections. The result is faster (no app JavaScript), cheaper (no monthly fee), and more maintainable. The only caveat: you need a developer to build the sections — the no-code drag-and-drop is gone.

All articles →
Shopify Development · 13 min readShopify Selling Plans API: Building Native Subscriptions Without Third-Party AppsShopify Development · 9 min readShopify Functions vs Apps: When to Use EachShopify Development · 13 min readShopify GraphQL Admin API: Practical Patterns for Developers