Building a metaobject
This page was printed on Jun 01, 2023. For the current version, visit https://help.shopify.com/en/manual/custom-data/metaobjects/building-a-metaobject.
You can create metaobjects from two locations in your Shopify admin:
- From Content > Metaobjects
- From Settings > Custom data
When you create a metaobject, you specify the following information:
- the name, which is used to identify the metaobject in your Shopify admin
- the type, which is used to identify the metaobject in the APIs
- the fields, which define the type of content you want to display in the metaobject
- Each field has a name, description, type, and validation rules such as character limits, minimum and maximum values, or preset values.
- For example, you might add a field for text, a field for an image, and a field for color.
On this page
Build a new 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 defintion. A type for your metaobject is automatically generated, and can be edited prior to saving the metaobject.
- Click Add field and select the content type you want to contain in this metaobject. For example, single line text. Each field has its own set of options and validation rules.
- Configure the field and its validation information:
- Optional: In the Description field, enter a description for your metaobject.
- Choose whether the field will be the entry’s display name by selecting Use this field as display name. The display name is the field that’s used to generate a searchable name in the index view. The display name is automatically set to the first text-based field in your metaobject definition or generated automatically if there is no text field.
- Configure the validation rules for the field, and then click Add.
- Optional: To allow storefront visibility, select Accessible from the Storefront visibility drop-down menu.
- Add additional fields to your metaobject as needed.
- Click Save.
After your metaobject has been saved, you can start creating entries.
Deleting 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.
- From your Shopify admin, go to Settings > Custom data.
- In the Metaobjects section, click the metaobject that you want to delete.
- Click Delete. A confirmation dialog displays to confirm that you want delete the entry.
- Click Delete to remove the entry.