Metaobjects help you add and store additional structured information for your store. For example, you can store information for a product, such as features, specifications, and size charts.
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 metafield in your Shopify admin, such as
- Type: the type of data that the metafield stores, such as text, file, or URL.
Fields: define the type of content you want to display in the metaobject
- Each field has a name (required), description, type, and 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.
- Access: By default, Storefronts access is activated for your metaobject. This means that the metaobject can be connected in your theme using dynamic sources. You can deactivate Storefronts access. Learn more about access options.
- Features: You can use the metaobject to create Web pages. Learn more about building web pages with metaobjects.
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 product taxonomy and standard categories use metaobjects as well. 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 > Shirts & Tops, then you can add category metafields for
sleeve length type,