Help Center
English
Contents

Create and edit metafield definitions

Set up a custom field and choose the rules its values must follow.

Create a definition
  1. Open Settings > Metafield Definitions.

  2. Choose Add definition.

  3. Choose what the field applies to, such as Products, Customers, or Orders.

  4. Enter a clear name and an optional description for your staff.

  5. Enter a namespace and key, such as details and care. The namespace groups related fields and the key names this field within it. Namespaces that start with app: are reserved for installed apps. Neither can be changed later.

  6. Choose the value type and add any validation rules you need.

  7. Choose storefront, search, filter, or translation options when they are available for that field.

  8. Save the definition, then add values to the resources it applies to.

Available value types include single line text, multi-line text, rich text (headings, bold, italic, links and lists), colors, numbers, true or false, dates, date and time, URLs, choices, JSON, files, and references to products, variants, pages, blog posts and collections. Some types can also store a list of values. Store Admin shows only the options supported by the selected resource and value type: multi-line and rich text can be translated and searched, colors can be used as storefront filters on products and variants, and references show shoppers the referenced item in their language.

When you delete a page, blog post or collection that custom data values point to, it is removed from those values. The delete confirmation shows how many values use it.

Custom content and List of custom content point to entries of one custom content type, which you choose when you create the definition and cannot change later. A list holds up to 50 entries. When you delete an entry, it is removed from every value that points to it; see Custom content.

Use names shoppers and staff can understand

The definition name is shown to staff in Store Admin. It is also the label shoppers see next to the value in a Metafield block, unless you write another label in the block, and, for cart line fields such as a gift message entered on the product page, next to the value in their cart. Translate it for each storefront language with the translate button next to the name, or in Translations > Metafield names.

Edit a definition

You can also create, edit, and delete your store's definitions from a connected AI tool, such as an assistant you connected to your store (see Accounts > Connected tools). The same rules apply. Definitions that installed apps add can be changed only by those apps.

You can change the name, description, validation rules, display order, and supported visibility or translation settings later. What the field applies to, its namespace and key, and its value type remain fixed so saved values and connected integrations keep the same meaning.

Editing a choice label keeps the saved choice selected. Existing choice keys stay fixed in the form. You cannot remove a choice that saved values still use, or reduce a value-length or list-size limit below existing values. Clear or update the affected values first. Other stricter validation rules apply when a value is next saved; existing values are not rewritten automatically.

Was this page helpful?