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

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

Common metafield content types and values
Content type Description Example
Color Supports RGB values in #RRGGBB format. 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. Add product expiration dates.
Date and time Supports date values in ISO 8601 format and time values in UTC time. 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. 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. 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. Add the volume capacity of a water bottle.
Number

Supports either integer or decimal values, depending on how you configure your definition.

  • 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. Add an audience score or a star rating for a product.
Product reference Supports linking to a single product. Store and display related products on product 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 of less than 20 MB in one of the following file types:

  • images
  • all file types

Images in JPEG, PNG, and GIF formats are displayed on your online store. All other file types are displayed as available for download.

Add a PDF file for assembly instructions.
Page reference Provides a link to a page in your online store. Add a link to a policy page, blog post, or detailed care guide on your online store.
URL Supports HTTP, HTTPS and mailto: URLs. You can limit URLs to specific domains when you create your metafield definition. 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.

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.

Ready to start selling with Shopify?

Try it free