Skip to main content

Metafields and Metaobjects

Metaobjects and metafields are structured ways to store (metaobjects) and present information (metafields) to your customers.

Written by Nuno Batista

Products often come in a lot of different styles, sizes, shapes, and materials. It can be a lot to store or share with your customers on your storefront.

Metaobjects and metafields are structured ways to store (metaobjects) and present information (metafields) to your customers. They can be used throughout your Shopify store, not just in a customer-facing way, but on the backend as well to help collect product information and more.

With metafields, you can show specialized bits of information that aren’t normally displayed or tracked within the Shopify admin. The information you display can be stored in metaobjects.

We’ll start by heading to the Settings of the Shopify, then going down to Metafields and Metaobjects.

Metafields are what you’ll see first, but at the very bottom of the page is metaobjects. If you already have metaobjects for your Shopify store, then you’ll see them there. Regardless of if you have already or not, you can create a new one by clicking Add definition.

When you create a metaobject, you can give it a name, description, and different fields of data it will store - from single line text, to integer numbers, to even other metaobjects.

With a metaobject created, you can use it in a variety of places - like in products. Use metaobjects to store specific information about a product that you, your employees, or your customers will need to know.

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 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.

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.

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.

In order to truly use metaobjects though, you’ll need to make a metafield for it.

First head back to the Metafield and Metaobject section of the settings in the Shopify. Instead of the lower section, we’re going to look at the upper section. This is where we can set definitions for our metafields.

Click Add definition to start making a new metafield.

When you click into it, you’ll see it looks similar to the metaobject definition section, but if you look closer - it’s actually a bit different. You still have the name and description - but there is also the namespace and key field.

Consider these examples for using metafields in your store:

  • If you have an apparel store and you want to add care instructions for your products, then you might add a Product metafield called Care instructions. You can then add different care instructions for one or all of your products.

  • If you have a children's toy store and you want to display recommended ages and potential hazards for your products, then you might add Product metafields called Recommended age. Instead of adding this information to your product description, you can display each field in its own section of your theme, with unique values for each product.

  • If you have a furniture store and you want to display detailed measurements, then you might add a Product metafield called Dimensions. Instead of including measurements in your product description, you can display width, height, and depth in a dedicated section of your theme, with unique values for each product.

With both metaobjects and metafields, you can improve the quality of your product listings by providing valuable information to your customer.

Examples of components that need metafields ans metaobjects are - Product Stories, Product Attribute Carousel, Product Insight, Product Info Grid...

Did this answer your question?