Adding values to metafields

After you add a metafield definition, you add values for your metafield on the corresponding pages in your Shopify admin. For example, if you create a metafield definition for product expiration date, then you enter the specific values for expiration date on your product pages in your Shopify admin. Adding values to your metafields enables you to save specialized information for internal tracking or for display on your online store.

Metafields are displayed in an editable table on your Shopify admin pages. Each metafield displays the name that you selected when you created your metafield definition. You can click in each table row to display the type of metafield and its description, and then enter a value.

After you add values to your metafields, you can connect your metafields to your theme to display your custom information on your online store.

Metafield content types and values

The following table contains basic instructions for adding values to common types of metafields, as well as example use cases for each type. For more information, refer to the developer documentation for metafields.

Metafield content types and values
Content type Description Example
Color

Supports RGB values in #RRGGBB format.

On the product that you want to edit, find the color metafield and then click Select color. Use the color picker to select a colour, or enter an RGB color value into the Color field.

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.

On the product that you want to edit, click on the date metafield, and then use the calendar to select a date.

Add product expiration dates.
Date and time

Supports date values in ISO 8601 format and time values in UTC time.

On the product that you want to edit, click on the date and time metafield. Click on the calendar to select a date, and then click on the time field to select a time.

Add launch event dates or product release dates.
Dimension

Supports both whole number and decimal values. The units of measurement can be configured using either the metric or the imperial system.

On the product that you want to edit, find the dimension metafield. Click in the field to enter a value, and then select a unit of measurement from the dropdown menu.

Add box heights or product lengths, such as the length of a scarf.
Weight

Supports both whole number and decimal values. The units of measurement can be configured using either the metric or the imperial system.

On the product that you want to edit, find the weight metafield. Click in the field to enter a value, and then select a unit of measurement from the dropdown menu.

Add the weight of a product or ingredient, for example, grams of sugar.
Volume

Supports both whole number and decimal values. The units of measurement can be configured using either the metric or the imperial system.

On the product that you want to edit, find the volume metafield. Click in the field to enter a value, and then select a unit of measurement from the dropdown menu.

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.

On the product that you want to edit, find the integer or decimal metafield. Click in the number field to enter a value.

An integer metafield might add a page count for books.

A decimal metafield might add a carat weight for jewelry.

Rating

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

On the product that you want to edit, find the rating metafield, and then click in the rating field to enter a value.

Add an audience score or a star rating for a product.
Product reference

Supports linking to one or more products, depending on how you configure your metafield definition.

On the product that you want to edit, find the product reference metafield and then click Select product or Select products. Select one or more products from the list.

Store and display related products on product pages in your online store.
Product variant reference

Supports linking to one or more product variants, depending on how you configure your metafield definition.

On the product that you want to edit, find the product variant reference metafield and then click Select variant or Select variants. Select one or more variants from the list.

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

On the product that you want to edit, find the file reference metafield. Click Select image or Select file. Select an available file, or click Upload image or Upload file to select a file from your device. After you add an image, you can click on the preview to add ALT text.

Add a PDF file for assembly instructions.
Page reference

Provides a link to a page in your online store.

On the product that you want to edit, find the page reference metafield. Click Select, and then select a page from the dropdown menu.

Add a link to a privacy 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.

On the product that you want to edit, find the URL metafield. Click in the field to enter a valid URL.

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.

On the product that you want to edit, find the single-line text or multi-line text metafield. Click in the field to enter your text.

Add shipping notes, announcements, or washing instructions.
True or false

Creates a checkbox for selecting whether a condition is true or false.

On the product that you want to edit, find the true or false metafield, and then select True or False.

Add whether an option is available, such as whether an item can be engraved.
JSON

Supports raw JSON data for advanced scenarios when you need a structured data source.

On the product that you want to edit, find the JSON metafield. Click in the field to enter your data.

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