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
- Go to Settings › Custom data › Products (or Collections) and select Add definition.
- Enter a Name. Under it, select the namespace and key and change them to exactly what the table below says, for example
custom.subtitle. - Pick the Type from the table (for example Single line text, or List of single line texts for
custom.highlights) and save. - 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.
| Metafield | Type | Used by |
|---|---|---|
custom.subtitle | Single line text | The line under the title on product cards, with Show product type on in Theme settings › Product cards. |
custom.badge | Single line text | Your own tag on the product card photo, such as Bestseller. A product tag like badge:Bestseller works too. |
custom.highlights | List of single line texts (or multi-line text) | The Highlights block when it has no text of its own. |
custom.specs | Multi-line text, one Label: value per line | The Specifications block and the Compare table. Any other key works if you enter it in the settings. |
custom.siblings | List of products | The Other colors block. |
custom.sibling_label | Single line text | The color or style name in Other colors, such as Sage. |
custom.sibling_group | Single line text | The heading of Other colors, such as Color or Style. |
custom.sibling_color | Color | The swatch color in Other colors. |
custom.banner_image (collection) | File | A banner photo for the collection page, instead of the collection image. |
reviews.rating, reviews.rating_count | Rating, Integer | Star ratings. Filled by your reviews app – do not create them yourself. |
| Color (category metafield) | Color | Color 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:
- Go to Settings › Custom data › Metaobjects and select Add definition. Name it Team member; its type becomes
team_member. - Add fields: Name (single line text, key
name), Role (single line text, keyrole), Bio (multi-line text, keybio) and Photo (file, keyphoto). - Turn on Storefronts access for the definition and save. Without it, the theme cannot read the entries.
- Add entries in Content › Metaobjects.
- In the theme editor, add the Metaobject entries section. Enter
team_memberin Definition type, and the field keys:namein Title field,rolein Subtitle field,bioin Text field andphotoin 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.