You can use metafields to add custom fields to objects such as products, customers, and orders. Metafields are useful for storing specialized information, such as part numbers, customer titles, or blog post summaries. They can be used by apps and channels to track data for internal use.
For example, you can use metafields in the following ways:
- Add fields to a resource (such as a product, product variant, or customer).
- Customize the appearance of your storefront and show more information.
- Store and transfer data between your store and another ecommerce system such as a CRM, ERP, or IMS.
- Track internal data that an app needs.
You need to use an app to create and manage metafields.
Metafields have three parts:
- Namespace - A category or container that differentiates your metadata from other metafields.
- Key - The name of the metafield.
- Value - The content of the metafield. In most cases, the value is what will be displayed on the storefront or used by the app.
For example, the following metafields specify the washing instructions for an item of clothing:
For more examples, see The metafield object.
Creating and managing metafields
If you create product metafields, then you can edit their values by using the bulk editor in the Shopify admin.
The following limitations apply to metafields:
- You cannot search for metafields or filter by a metafield in the Shopify admin. If you have a use case where you need to do so, then try using tags instead of metafields.
- Shopify analytics and reports do not contain information about metafields, but there are apps that provide reports that include metafields.
- Shopify Scripts and the Wholesale channel do not support metafields.
Show metafields in the storefront
To show metafield details in your storefront, use the metafields object in your Liquid theme pages (including checkout.liquid) and in other locations where Liquid variables are supported.
For example, you could use the following Liquid code to display the example washing instructions on a product page:
If you want your customers to be able to search for, or filter by, metafields in your online store, then install a search app.
Learn more about metafields
See the following references for more information about metafields: