Building a metaobject
Metaobjects are custom data structures that you define to store and manage structured content, such as product highlights, size charts, or ingredients lists. You can create metaobjects from either of the following locations in your Shopify admin:
- From Content > Metaobjects
- From Settings > Custom data
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.
On this page
Create a metaobject
- From your Shopify admin, go to Content > Metaobjects or Settings > Custom data.
- Click Add definition.
- In the Name field, enter a name for your definition. A type identifier for your metaobject is automatically generated from the name, and can be edited before you save the metaobject.
- Click Add field. An inline row displays with a Field label input and a Select field type button.
- Enter a label for the field, such as
DescriptionorImage. - Click Select field type, and then search for or select the type that matches your field. For example, Single line text or File > Image.
- Optional: To make the field required, click the asterisk (*) beside the Field label input.
- Optional: To configure validation rules or add a description, click the expand arrow beside the row:
- If a Validation tab appears, then configure the rules to limit the accepted values for the field.
- In the Description tab, enter a description for the field.
- Optional: To add more fields, click Add field again. You can drag fields to reorder them.
- Optional: To turn off storefront access, deselect Storefronts from the Access section.
- Optional: To allow entries from this metaobject to be published as stand-alone pages, select Web pages under Features.
- Click Save.
After your metaobject has been saved, you can start creating entries. You can also create metaobject definitions directly from reference fields on resource pages, such as products, without navigating to Settings.
Delete a metaobject
Deleting a metaobject can't be undone. If you delete a metaobject, then all the entries for that metaobject will also be deleted.
Steps:
From your Shopify admin, go to Settings > Metafields and metaobjects.
In the Metaobjects section, click the metaobject that you want to delete.
Click Delete, and then click Delete again to confirm.