Metafields and metaobjects

The product and collection metafields Index reads, how to create them, and how to show any metaobject on your store with the Metaobject entries section.

Metafields add your own fields to products and collections – a subtitle, highlights, specifications. Metaobjects are your own content types – team members, ingredients, stockists – with as many entries as you like. Both are set up in Settings › Custom data, with no code.

Create a metafield

  1. Go to Settings › Custom data › Products (or Collections) and select Add definition.
  2. Enter a Name. Under it, select the namespace and key and change them to exactly what the table below says, for example custom.subtitle.
  3. Pick the Type from the table (for example Single line text, or List of single line texts for custom.highlights) and save.
  4. Open a product. The new field is in the Metafields card at the bottom of the page; fill it in and save.

Metafields Index reads

All are product metafields in the custom namespace unless noted.

MetafieldTypeUsed by
custom.subtitleSingle line textThe line under the title on product cards, with Show product type on in Theme settings › Product cards.
custom.badgeSingle line textYour own tag on the product card photo, such as Bestseller. A product tag like badge:Bestseller works too.
custom.highlightsList of single line texts (or multi-line text)The Highlights block when it has no text of its own.
custom.specsMulti-line text, one Label: value per lineThe Specifications block and the Compare table. Any other key works if you enter it in the settings.
custom.siblingsList of productsThe Other colors block.
custom.sibling_labelSingle line textThe color or style name in Other colors, such as Sage.
custom.sibling_groupSingle line textThe heading of Other colors, such as Color or Style.
custom.sibling_colorColorThe swatch color in Other colors.
custom.banner_image (collection)FileA banner photo for the collection page, instead of the collection image.
reviews.rating, reviews.rating_countRating, IntegerStar ratings. Filled by your reviews app – do not create them yourself.
Color (category metafield)ColorColor swatches. Filled from the product's category in Shopify. See Color swatches.

Metaobjects

The Metaobject entries section shows the entries of any metaobject as a grid or an accordion. For example, a team page:

  1. Go to Settings › Custom data › Metaobjects and select Add definition. Name it Team member; its type becomes team_member.
  2. Add fields: Name (single line text, key name), Role (single line text, key role), Bio (multi-line text, key bio) and Photo (file, key photo).
  3. Turn on Storefronts access for the definition and save. Without it, the theme cannot read the entries.
  4. Add entries in Content › Metaobjects.
  5. In the theme editor, add the Metaobject entries section. Enter team_member in Definition type, and the field keys: name in Title field, role in Subtitle field, bio in Text field and photo in Image field.

Link field can be a URL, product, collection or page field; it links each entry. With the Accordion layout, the title field becomes the question and the text field the answer – an easy way to keep FAQs in one place and show them on several pages.

The section stays hidden while the definition has no entries.

See all Metaobject entries settings.