Metafields

You can use metafields to add custom fields to objects such as products, customers, and orders. They are useful for storing information that doesn't otherwise have a home in Shopify, such as part numbers, customer titles, or blog post summaries. Also, they are often used by apps and channels to track data for internal use.

Metafields are an advanced feature and you need an app to create and manage them. Unless you install an app, you can use metafields only in limited ways.

Metafields have three parts:

  1. Namespace - A category or container that helps differentiate your metadata from other similarly named metafields

  2. Key - The name of the metafield.

  3. 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:

Namespace Key Value
Acme134-instructions Wash Cold water
Acme134-instructions Dry Tumble dry

Metafield examples

You can use metafields to:

  • 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 an CRM, ERP, or IMS.
  • track internal data needed by an app

For examples, see Metafield Liquid object.

Create and manage metafields

To create, edit, or delete metafields, you need to use an app. The Shopify App Store has a number of metafield apps available for you to choose from. You can also use the Metafield API to create your own app.

Show metafields in the storefront

To show metafield details in your storefront, use the Metafield 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 to display the washing instructions on a product page:


{% unless product.metafields.Acme134-instructions.Wash == blank %}
Wash: {{ product.metafields.Acme134-instructions.Wash }}
{% endunless %}

Advanced feature requirements

Metafields are an advanced feature and you need an app to create and manage them. The following list contains some of the limitations of metafields:

  • There are editing apps available on the Shopify App store. You can also edit the values for product metafields by using the bulk editor in the Shopify admin.

  • You can import and export a small subset of product metafields for SEO purposes and the Google Shopping App. If you need to import or export more metafields than these, then use an app.

  • To let your customers search for or filter by metafields in your online store, install a search app.

  • You cannot search for 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.

Learn about metafields

Want to discuss this page?

Visit the Shopify Community

Ready to start selling online with Shopify?

Try it free