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.

Pinned metafields are displayed in an editable table on your Shopify admin pages in the same order that they're displayed in your metafield definitions list. Each metafield displays the name that you selected when you created your metafield definition. You can click in each table row to display the metafield type and description, and then enter a value.

Metafields can only accept the supported values for their content type. For more information about supported values for common types of metafields, refer to metafield content types and values.

Metafield lists allow you to store multiple values in a single metafield. You can add multiple single line text fields or product reference values to a metafield list to organize large data sets, suggest items that work well together, or create more powerful search facets.

Adding values to common types of metafields

Which procedure you follow to add values to a metafield depends on the content type for that metafield. For example, metafields for product expiration date and customer birth date both use the Date content type.

The following examples describe the steps to add values to metafields that have different content types.

Color

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the color metafield, and then click Select color.

  4. Select a color by doing one of the following:

    • Use the color picker to select a color.
    • Enter an RGB color value in the Color box.
  5. Click Save.

Date

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the date metafield, and then use the calendar to select a date.

  4. Click Save.

Date and time

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the date and time metafield.

  4. Click the calendar to select a date, and then click the time box to select a time.

  5. Click Save.

Dimension

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the dimension metafield, and then enter a value.

  4. Select a unit of measurement from the list.

  5. Click Save.

Weight

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the weight metafield, and then enter a value.

  4. Select a unit of measurement from the list.

  5. Click Save.

Volume

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the volume metafield, and then enter a value.

  4. Select a unit of measurement from the list.

  5. Click Save.

Number

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the number metafield, and then enter a value.

  4. Click Save.

Rating

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the rating metafield, and then enter a value.

  4. Click Save.

File reference

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the file reference metafield, and then click Select image, Select video, or Select file.

  4. Optional: To upload a file from your device, click Upload image, Upload video, or Upload file, select a file from your device, and then click Open.

  5. Select the file that you want to add and then click Done.

  6. Optional: To add ALT text to an image, click the preview image, enter a description in the ALT text box, and then click Done.

  7. Optional: To edit the cover image of a video, click Change to select the new cover image, and then click Done.

  8. Click Save.

Page reference

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the page reference metafield.

  4. Click Select, and then select a page from your online store.

  5. Click Save.

Product reference

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the product reference metafield.

  4. Click Select product, and then select a product from the list.

  5. Click Save.

Product variant reference

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the product variant reference metafield.

  4. Click Select variant, and then select a product variant from the list.

  5. Click Save.

Metaobject reference

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the metaobject reference metafield.

  4. Click Select entry, and then select an entry from the list.

  5. Click Save.

Collection reference

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the collection reference metafield.

  4. Click Select collection, and then select a collection from the list.

  5. Click Save.

URL

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the URL metafield, and then enter a valid URL.

  4. Click Save.

Single-line or multi-line text

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the text metafield.

  4. Depending on how you configured your metafield definition, do one of the following:

    • Enter your text.
    • Click Select an option, and then select a preset option from the list.
  5. Click Save.

True or false

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the true or false metafield, and then select True or False.

  4. Click Save.

JSON

  1. From your Shopify admin, go to the part of your store where you want to add a metafield value. For example, a specific product, collection, or customer.
  2. Navigate to the Metafields section, where the applicable metafield definitions display in a list.

  3. Click the JSON metafield, and then enter your data.

  4. Click Save.

Next steps after adding values to metafields

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

Can’t find the answers you’re looking for? We’re here to help.