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.

Build a new metaobject

Steps:

  1. From your Shopify admin, go to Content > Metaobjects or Settings > Custom data.
  2. Click Add definition.
  3. 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.
  4. 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.
  5. Configure the field and its validation information:
    1. Optional: In the Description field, enter a description for your metaobject.
    2. 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.
    3. Configure the validation rules for the field, and then click Add.
  6. Optional: To allow storefront visibility, select Accessible from the Storefront visibility drop-down menu.
  7. Add additional fields to your metaobject as needed.
  8. 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.

Steps:

  1. From your Shopify admin, go to Settings > Custom data.
  2. In the Metaobjects section, click the metaobject that you want to delete.
  3. Click Delete. A confirmation dialog displays to confirm that you want delete the entry.
  4. Click Delete to remove the entry.

Ready to start selling with Shopify?

Try it free