Metafield content types and values

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

  • 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.

Metafield content types are grouped by category based on the value of the metafield type. For example, Dimension, Volume, and Weight are all types of measurement data, and are grouped together in the Measurement category. Metafield content types are grouped into the following categories:

  • Date and time
  • Measurement
  • Number
  • Text
  • Reference
  • Other
  • Advanced

Your most frequently used metafield types are grouped in the Most used section for easier access.

Date and time

Date and time metafield types
Content typeDescriptionUse in a listExample
Date and timeA date and time value. This metafield type supports date values in ISO 8601 format and time values in UTC time.YesAdd launch event dates or product release dates with times.
DateA date and time value. This metafield type supports date values in ISO 8601 format and time values in UTC time.YesAdd launch event dates or product release dates.

Measurement

Measurement metafield types
Content typeDescriptionUse in a listExample
DimensionThis metafield type supports both whole number and decimal values. Dimension uses either metric or imperial units of measurement.YesAdd box heights or product lengths, such as the length of a scarf.
VolumeThis metafield type supports both whole number and decimal values. Volume uses either metric or imperial units of measurement.YesAdd the volume capacity of a water bottle.
WeightThis metafield type supports both whole number and decimal values. Weight uses either metric or imperial units of measurement.YesAdd the weight of a product or ingredient, for example, grams of sugar.

Number

Number metafield types
Content typeDescriptionUse in a listExample
DecimalDecimal values can be in the range of +/-9999999999999.999999999, with up to 13 digits before the decimal and up to 9 digits after.YesAdd a carat weight for jewelry.
IntegerInteger values can be in the range of -4,611,686,018,427,387,904 to 4,611,686,018,427,387,903.YesAdd a page count for books.

Text

Text metafield types
Content typeDescriptionUse in a listExample
Multi-line text

This metafield type supports plain text with line breaks.

You can choose your minimum and maximum lengths and regular expression rules.

NoAdd shipping notes or return policies.
Rich text

This metafield type supports text with line breaks and inline styling, including heading styles, bold, italic, and underline.

Can only be connected to theme settings that work with rich text.

Themes handle styling in different ways, which might override the styles you apply here. Check with your theme’s documentation to better understand how the rich text metafield will be styled in your theme.

NoAdd long-form stories about your brand or product, including styling.
Single line text

This metafield type supports plain text with no line breaks.

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

YesAdd short notes and announcements.

Reference

Reference metafield types
Content typeDescriptionUse in a listExample
CompanyThis metafield type supports linking to one or more companies in a metafield list.YesAdd a company metafield in the Companies section of your Shopify admin to connect related companies.
CustomerThis metafield type supports linking to one or more customers in a metafield list.YesAdd a customer metafield in the Customers section of your Shopify admin to connect related customers.
ProductThis metafield type supports linking to one or more products in a metafield list.YesStore and display featured products on product pages or collection pages in your online store.
CollectionAllows you to link to an existing collection. This metafield type supports linking to one or more collections in a metafield list.YesInclude a "Complete the look" collection for fashion products in your online store.
Product variantThis metafield type supports linking to one product variant.YesStore and display other clothing items in the same color on product pages in your online store.
File

This metafield type 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.
    • Will render as an image when used in theme settings.
  • Videos
    • Videos must be less than 1 GB, and less than ten minutes in length. Accepted formats: MOV and MP4.
    • Will render as a video when used in video-type theme settings, or fall back to an image when used in image-type settings.
  • All file types
    • Generic files must be less than 20MB.
    • Will render as a downloadable link in themes.

Refer to File format requirements for supported file types.

YesAdd a PDF file for assembly instructions.
MetaobjectThis metafield type supports linking to a single or multiple metaobject entries.YesAdd and display a custom influencer profile on select product pages.
PageAllows you to link to an existing page. This metafield type supports linking to a single or multiple pages in a metafield list.YesInsert your policy page or a detailed care guide on products in your online store.

Other

Other metafield types
Content typeDescriptionUse in a listExample
True or falseCreates a checkbox for selecting whether a condition is true or false.NoAdd whether an option is available, such as whether an item can be engraved.
ColorThis metafield type supports RGB values in #RRGGBB format.YesStore the color of a product and then set the background of the product page to the same color.
RatingThis metafield type supports decimal values along a given scale, depending on how you configure your definition.YesAdd an audience score or a star rating for a product.
URLThis metafield type supports HTTP, HTTPS, mailto:, sms:, and tel: URLs. You can limit URLs to specific domains when you create your metafield definition. YesAdd a link to book reviews or product videos that are hosted on a specific website.
MoneyThis metafield type supports both whole number and decimal values. Currency code must match store currency.NoTrack product cost details, such as distributor cost or ship to warehouse cost.
LinkThis metafield type supports single-line plain text with no line breaks, and HTTP, HTTPS, mailto:, sms:, and tel: URLs. You can limit URLs to specific domains when you create your metafield definition.YesAdd a link to book reviews or product videos that are hosted on a specific website.

Advanced

Advanced metafield types
Content typeDescriptionUse in a listExample
JSONThis metafield type supports raw JSON data for advanced use cases when you need a structured data source.NoAdd a table of specifications that has different columns for each product, for example, tables of ingredients.
Mixed reference

This metafield type supports references of any type.

Developer support is needed to use this type in your storefront. Learn more about custom data for developers.

YesCreate dynamic landing pages in your Hydrogen Storefront.
Can’t find the answers you’re looking for? We’re here to help.