Metafield content types and values

Each type of metafield accepts a range of supported values for different use cases. Refer to the table of common metafield content types for information about the following:

  • supported values for each type of metafield
  • example use cases for each type of metafield
  • if the content type can be used as a metafield list

For more information, refer to the developer documentation for Metafields.

Common metafield content types
Content type Description Example
Color Supports RGB values in #RRGGBB format.

Color fields can be used in a list of values.

Store the color of a product and then set the background of the product page to the same color.
Date Supports date values in ISO 8601 format, without a time zone.

Date fields can be used in a list of values.

Add product expiration dates, order delivery dates, or customer birth dates.
Date and time Supports date values in ISO 8601 format and time values in UTC time.

Date and time fields can be used in a list of values.

Add launch event dates or product release dates.
Dimension Supports both whole number and decimal values. Dimension uses either metric or imperial units of measurement.

Dimension fields can be used in a list of values.

Add box heights or product lengths, such as the length of a scarf.
Weight Supports both whole number and decimal values. Weight uses either metric or imperial units of measurement.

Weight fields can be used in a list of values.

Add the weight of a product or ingredient, for example, grams of sugar.
Volume Supports both whole number and decimal values. Volume uses either metric or imperial units of measurement.

Volume fields can be used in a list of values.

Add the volume capacity of a water bottle.
Number

Supports either integer or decimal values, depending on how you configure your definition. Both integer and decimal fields can be used in a list of values.

  • Integer values can be in the range of -4,611,686,018,427,387,904 to 4,611,686,018,427,387,903.
  • Decimal values can be in the range of +/-9999999999999.999999999, with up to 13 digits before the decimal and up to 9 digits after.

An integer metafield might be used to add a page count for books.

A decimal metafield might be used to add a carat weight for jewelry.

Rating Supports decimal values along a given scale, depending on how you configure your definition.

Rating fields can be used in a list of values.

Add an audience score or a star rating for a product.
Product reference Supports linking to a single or multiple products in a metafield list. Store and display featured products on product pages or collection pages in your online store.
Product variant reference Supports linking to a single product variant. Store and display other clothing items in the same color on product pages in your online store.
File reference

Supports uploading a single file in one of the following file types:

  • Images
    • Images must be less than 20 MB. Accepted formats: JPEG, PNG, WEBP, HEIC, and GIF.
  • Videos
    • Videos must be less than 1 GB, and less than ten minutes in length. Accepted formats: MOV and MP4.
  • all file types
    • Generic files must be less than 20MB.

Images and videos can be displayed on your online store or used as a downloadable resource. Generic files are intended for downloading only.

Refer to File format requirements for supported file types.

Add a PDF file for assembly instructions.
Page reference Allows you to link to an existing page. Supports linking to a single or multiple pages in a metafield list. Insert your policy page or a detailed care guide on products in your online store.
Collection reference Allows you to link to an existing collection. Supports linking to a single or multiple collections in a metafield list. Include a "Complete the look" collection for fashion products in your online store.
URL Supports HTTP, HTTPS and mailto: URLs. You can limit URLs to specific domains when you create your metafield definition.

URL fields can be used in a list of values.

Add a link to book reviews or product videos that are hosted on a specific website.
Text

Supports plain text in either single-line or multi-line fields. Multi-line fields can include line breaks.

Single and multi-line text fields can be used in a list of values.

You can limit single-line fields to preset choices that you specify when you create your metafield definition.

Add shipping notes, announcements, or washing instructions.
True or false Creates a checkbox for selecting whether a condition is true or false. Add whether an option is available, such as whether an item can be engraved.
JSON Supports raw JSON data for advanced use cases when you need a structured data source. Add a table of specifications that has different columns for each product, for example, tables of ingredients.
Money Supports both whole number and decimal values. Currency code must match store currency. Track product cost details, such as distributor cost or ship to warehouse cost.

Ready to start selling with Shopify?

Try it free