Insert a metafield into a snippet

Metafields let you save and display specialized information that isn't usually captured in the Shopify admin. For example, a candle seller might want to display a burn time for candles on their product pages, whereas a grocery store might want to display a product expiration date for canned goods. Other examples of specialized information include:

  • part numbers
  • color swatches
  • launch dates
  • related products
  • blog post summaries
  • files for download
  • lists of ingredients

You can add metafields to your products, variants, and other parts of your store, directly from your Shopify admin.

To show a metafield on a page without Descriptions Studio, you need to edit your theme code, or add sections or blocks that support dynamic sources to your theme's page templates using the theme editor. These methods have some important drawbacks to keep in mind:

  • Metafields don't update automatically when the variant is changed.
  • It's difficult or impossible to show metafields conditionally based on collection, tag, type, vendor, price, weight, inventory, or other criteria.
  • Customizing code requires technical knowledge and can be time-consuming to set up and maintain.
  • Theme updates or platform changes may break customizations.
  • Adding new metafields often means editing code again.
  • Dynamic sources depend on theme support and may limit flexibility in displaying metafields.
  • Complex or custom variant options might not be fully supported by dynamic sources.

Descriptions Studio avoids these drawbacks, making it quick and easy to show variant, product, or store metafields on all of the relevant product pages without any coding or complicated setup.

All metafields in a snippet update automatically when the variant is changed

To insert a metafield into a snippet:

  1. From the Descriptions Studio app, go to Snippets.

  2. Click the name of the snippet that you want to edit, or create a new snippet .

  3. On the snippet details page, in the Content area, click the Insert/edit property or metafield button.

    The 'Insert/edit property or metafield' button in the snippet content rich text editor
    The 'Insert/edit property or metafield' button in the snippet content rich text editor
  4. In the Insert/edit property or metafield dialog, click Insert metafield.

    The 'Insert/edit property or metafield' dialog
    The 'Insert/edit property or metafield' dialog
  5. Under Resource, select the resource that the metafield belongs to.

    The 'Insert/edit metafield' dialog
    The 'Insert/edit metafield' dialog
  6. In the Search metafield definitions field, enter a search keyword to search your metafields definitions.

    In the search results, select the metafield definition for the metafield that you want to insert.

  7. Optional

    Under Hide parent if metafield is empty, select the parent element to hide if the metafield is empty.

    For example, if the metafield is in a table, select Table row to hide the entire table row if the metafield doesn't have a value.

  8. Optional

    Under Filters, click Add filter to add a filter that formats the display of the metafield.

  9. Click Insert to insert the metafield in the snippet.

  10. Click Save to save the snippet.

Still need help? Contact Us Contact Us