Metaobjects

If your data is best represented by multiple fields, you can use a metaobject to create an object with multiple fields. Your metaobject can be referenced by metafields or used stand-alone.

Why use Metaobjects

Consider these examples for using metaobjects in your store:

  • If you want to highlight the key features of your products, then you might create a metaobject called Product highlight. You can then include fields for an icon, title, and description, and display a unique set of highlights for each product in your theme.
  • If you have a beauty and skincare store and you want to capture and display information about your top influencers, then you might create a metaobject called Influencer profile. You can then include fields for a headline, image, description, and profile link, and create an entry for each influencer. You can display the influencer profile metaobject in your theme, or use it in your Shopify admin.
  • If you want to address common questions about your products or policies, then you might create a metaobject called FAQ. You can then include fields for a question and answer, create an entry for each frequently asked question, and display them in a dedicated section of your theme.
  • If you participate in trade shows or live events and you want to showcase your event history, then you might create a metaobject called Event appearance. You can then include fields for an event name, location, year, and description, and create an entry for each event. You can display your event history on your storefront to show customers and organizers that you have experience at scale.

How to use Metaobjects

You can retrieve and edit the data that's stored in metaobjects from the Shopify admin. Apps can access metaobjects through the metaobject API. You can also access metaobjects in themes using Liquid and through the Storefront API. Learn more about the metaobject API.

There are two key components to metaobjects:

  • Definition: the group of fields that defines the object’s structure. This is managed in Settings > Custom data in your Shopify admin.
  • Entries: the content or data for the metaobject. Entries are created and managed in Content > Metaobjects in your Shopify admin.

When you create a metaobject definition, you specify the following information:

  • Name: used to identify the metaobject in your Shopify admin, such as Authors.
  • Type: a unique identifier for the metaobject, automatically generated from the name. You can edit the type identifier before saving.
  • Fields: define the content you want to store in the metaobject.
    • Each field has a name (required), description, and type. You select a field type from a searchable list of categories and presets, such as text, file, or URL.
    • Optional: You can add validation rules, such as character limits, minimum and maximum values, or preset values.
    • Display name is assigned to a single field name and is used to identify an individual metaobject entry. You can change the field that the display name is assigned to at any time. The display name is automatically assigned to the first text field in a metaobject entry, or autogenerated if there are no text fields in the metaobject definition.
    • For example, you might add a field for text and indicate it as a display name, a field for an image, and a field for color.
  • Options: where the metaobject is available to use. Learn more about options for custom data.

The fields in your metaobject definition determine the fields in your metaobject entries. For example, if you create a metaobject for ambassador program profiles with a name, biography, an image for the fields, then your metaobject entries will have a field to enter the name, biography, and upload an image. Every entry in this example would be a single ambassador program profile.

Shopify's Standard Product Taxonomy and standard categories use metaobjects. When you add a product category to a product, you can add category metafields specific to that product. Each category metafield has default entries, which is built with metaobject definitions. For example, if you add the product category Apparel & Accessories > Clothing > Clothing Tops > Shirts, then you can add category metafields for size, neckline, sleeve length type, top length type, age group, fabric, target gender, clothing features, and color.

In this section