Appearance
Use metafields on product pages
This guide explains how to add a metafield to a product page to display additional information about a product.
For example, in the following image, a custom metafield displays the Manufacturer's Part Number MPN: 12345 inside a Text block on a store's Plain t-shirt product page.

Metafields store information. For example, you can create a metafield to store details about a product's physical dimensions. Then add the metafield to a block in a product section to display those dimensions on product pages. Refer to Shopify help: Use metafields and metaobjects with dynamic sources.
Note
For information that's typically stored in a metafield, Shopify provides standard metafield definitions. Refer to Shopify help: Adding standard metafield definitions.
You can also create custom metafield definitions. Refer to Shopify help: Creating custom metafield definitions.
As an example, this guide creates a custom metafield definition to store a Manufacturer's Part Number (MPN) for a product. The MPN is displayed in a Text block within a product section on a default product page.
To create a different custom metafield, adapt the steps in this guide to suit your requirements.
Define your custom product metafield
To define your custom product metafield:
In your Shopify admin, select Settings > Metafields and metaobjects.
On the Metafields and metaobjects page, select Products, and then choose Add definition.
In the Name field, enter a name for your metafield.
For example, to create a metafield for a Manufacturer's Part Number (MPN), in the Name field, enter mpn.
Note
You can also select a standard definition with a content type that corresponds to the information you want the metafield to store. For example, Shopify provides standard definitions for storing International Standard Book Numbers (ISBN), Product guides, Product subtitle, etc.
For a list of standard definitions and content types, refer to Shopify help: List of standard metafield definitions.
Note the Namespace and key displayed below the Name field.
Optional: To add a custom namespace and key, select Namespace and key, and then enter your required custom values. For example, for the mpn metafield, enter
custom.mpn.Optional: In the Add description > Description field, enter text to describe the metafield. For example, for the mpn metafield, enter Manufacturer's part number.
Use the Type pickers to:
- Set your metafield to store One value or List of values. For example, to set the mpn metafield to accept a single value, select One value.
- Select a content type for the metafield. For example, to set the mpn metafield to store integer numbers, select Number > Integer.
Where relevant, use the Validation options to define validation rules for your metafield.
For example, to set the mpn metafield to accept one unique, five-digit integer value per metafield instance:
- Enable the Unique values only option.
- In the Value range > Minimum value field, enter 00000.
- In the Value range > Maximum value field, enter 99999.
Note
Depending on the metafield's content type, different options and validation rules are displayed.
As an example, the following image shows a completed mpn metafield definition that's configured to accept one, unique, five-digit integer value per metafield instance.

Select Save to save your custom metafield definition.
Set values for your metafield
To set values for your metafield:
Note
The steps required to set values depend on the metafield's content type. Refer to Shopify help: Adding values to metafields.
Adapt the following steps to suit your requirements.
In your Shopify admin, select Products.
Choose a product from the Products list to open the Product editor.
At the bottom of the page, find the Product metafields area.
From the list, select the metafield you defined previously, and then enter the required values.
For example, select the mpn metafield, and then enter the value
12345.
Note
Depending on the metafield's content type, different options are displayed for entering values. Refer to Shopify help: Adding values to metafields.
Optional: Repeat these steps to add metafield values to other products.
Select Save to save the values you added to the metafield.
Add your metafield to a product section
To add your metafield to a product section:
Open your theme in the Theme editor. At the top of the Theme editor, use the template dropdown to select a product page, and then select a product section that will display your custom metafield.
For example, select Products > Default product > Product pages.
From the section's settings menu, select a block to contain the metafield.
For example, select a Text block.
Note
The block you select must support metafields.
Alternatively, to add a new block, select Add block, choose a block to add, and then select the block you added. Refer to Configure blocks inside a section.
From the block settings menu, choose a setting that supports metafields, and then select the Connect dynamic source icon.
For example, select the Connect dynamic source icon beside the block's Text option.
From the Connect dynamic source menu, select the metafield you defined previously.
For example, select the mpn metafield.
Optional: Enter a prefix to display with the metafield's value. For example, in the Text box, enter the prefix MPN:.

Verify that the metafield displays on the product page correctly.
For example, the following image shows a product section on a store's Plain t-shirt product page. Below the section's Buy it now button, a Text block displays the prefix MPN: and the mpn metafield value
12345.