Metafields
Metafields help you to customize the functionality and appearance of your Shopify store by letting you save specialized information that isn't usually captured in the Shopify admin. You can use metafields for internal tracking, or to display specialized information on your online store in a variety of ways. For example, a candle seller might want to display a burn time for candles on their product pages, while a grocery store might want to display a product expiration date for canned goods. Other examples of specialized information include the following:
- part numbers
- color swatches
- launch dates
- related products
- blog post summaries
- files for download
- lists of ingredients
You can add metafields to your products, collections, customers, orders, and other parts of your store, directly from your Shopify admin.
Learn more about使用metafields.
If you have anOnline Store 2.0 theme, then you can connect most metafields to your theme by using the theme editor. If you're using vintage themes, or if you want to add metafield types that your theme doesn't support, then you canedit your theme codeor hire a Shopify Expert to help you. Learn more about hiringShopify Experts.
Setting up new metafields involves the following tasks:
- Addingmetafield definitionsto add fields for your specialized information to pages in your Shopify admin
- Adding metafield valuesto parts of your store, such as products or variants
- Optional:Connecting metafields to your themeto display specialized information on your online store
You can alsomigrate existing metafields to a definition. Adding definitions for sets of metafields enforces validation rules to ensure that your metafield values are consistent and reliable. If your metafield values don't match the validation rules for your definition, then you canfix invalid metafield valuesafter migration.