What is a Metafield?
Metafields are a Shopify feature that provides extra storage space for additional data on your store's resources (products, collections, orders, etc.).
Key Components
| Component | Purpose |
|---|---|
| Namespace | Groups related metafields together (like folders) |
| Key | A unique identifier to reference stored information |
| Value | The actual data being stored |
Liquid Syntax
To display a metafield on your storefront, use this Liquid template syntax:
{{ product.metafields.namespace.key.value }}
Replace product with the appropriate resource type, and namespace/key with your metafield's actual values.
Creating Metafields
In Metafield Studio:
- Select the type of data
- Define the namespace
- Assign a key
- Enter the value
- Click Save
Metafields don't automatically affect your store's functionality or storefront appearance they are backend storage only. You must customize your theme (using Liquid code or theme extension blocks) to display them. Proper implementation requires matching the namespace and key between your metafields and the Liquid code or theme block configuration.
Official Shopify Documentation
For a deeper dive into metafields, check out the official Shopify documentation:
- Metafields overview What metafields are and how they work
- Metafield types All supported value types (text, number, URL, JSON, etc.)
- Metafield definitions How to create and manage definitions
- Metafields in Liquid Liquid object reference for rendering metafields in themes