Displaying metafields on your online store

After you add metafield definitions and assign metafield values to parts of your store, you can connect metafields to your theme to display your 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 that you can display on your online store include the following:

  • part numbers
  • color swatches
  • product release dates
  • related products or variants
  • product star rating
  • files for download

If you have an Online Store 2.0 theme, such as Dawn, the free Shopify theme, then you can connect most metafields to your theme by using the theme editor. If you're using a vintage theme, or if you want to add metafield types that your theme doesn't support, then you can edit your theme code or hire a Shopify expert to help you.

Connecting metafields to your theme by using the theme editor

If your theme supports metafields, then you can choose how to display metafields on your online store by using the theme editor. To find out which metafields are available in your theme, refer to your theme's documentation or contact your theme's developer.

You can connect metafields to your theme by adding sections or blocks that support dynamic sources. For example, the Product info section can support product metafields.

After you add a section or block, you can select a single metafield by clicking the connect dynamic source icon:

Connect dymamic source icon

If the connect dynamic source icon displays a +, then you can add up to 20 metafields by clicking the icon and then selecting one metafield at a time:

Insert dymamic source icon

For step-by-step instructions, refer to Using metafields and dynamic sources.

Editing your theme code to add metafields

If you want to edit your theme code to display metafields on your online store, then you can use Liquid to reference metafields in your page templates.

Edit your theme code only if you have coding experience. If you need help with editing your theme code, then you can hire a Shopify expert from the Shopify Experts Marketplace.

Ready to start selling with Shopify?

Try it free