How To Add Metafields to Products in Shopify

How To Add Metafields to Products in Shopify

Metafields are custom fields that store additional information about a product or customer in Shopify. You can use them to display extra product details, store customer preferences, or categorize products by type. When you add metafields to products in Shopify, you give customers more insight into your products, leading to more informed purchasing decisions and a better overall customer experience.

To add metafield to a product in Shopify, open Metafield in Settings and click Products > Add definition. Add the field’s name and select “Single/Multi-line-text in the “Content type” field. Navigate to Products, add the relevant details in the metafield sections, then link the fields to your Themes.

Below is a more detailed run-through step-by-step guide on how you can set up & add metafields to your products in Shopify with minimal effort.

Step-by-step: How to setup & add metafields to your products in Shopify

1. Create the metafields in Shopify Admin

The first step is creating the options for each metafields you plan to add to your shop’s products. To do this, here’s what you need to do:

  1. Navigate to Settings, then “Metafields“.
  2. Click on “Products“.
  3. Click on “Add definition“.
Adding definition to a product metafield on Shopify
  1. Add a Name to the metafield that describes its purpose. This will be used as an identifier when you apply them later.
  2. Click the “+ Select type” button and select “Text“, or “Multi-line-text” (or other options based on what type of data you want to be stored).
  3. Click “Save” and repeat the process for as many fields as needed.
Single or multi-line text for a metafield on Shopify

2. Add values to Your product metafields

Now that you have created all of your desired metafields, it’s time to add value to each one for each of your products. Here’s what you need to do next: 

  1. Navigate to your Product listings on your Shopify dashboard and select the product you want to assign one of your newly created metafields.
  2. Find the new metafield sections that have been added at the bottom (as long as you’ve already created those definitions from Step 1).
  3. Fill those sections in with relevant information or descriptions so they will appear on your product pages when customers view them.
Changing product metafields in the product listings on the Shopify dashboard

3. Link the metafields to your themes

Now it’s time to connect those custom fields with your Storefront theme design to show up on product pages when you browse them. Here’s how to do that:

  1. Go to “Themes” under “Online Store” on the Shopify dashboard.
  2. On the next page, click “Customize“.
  3. Navigate to the Product page where you want these fields to appear.
  4. From the “Product Overview” section in the toolbar, click “Add Block” and choose Accordion or similar block types available. Open up the next section, and give it a title using one of the previously created metafield names.
  5. In the text editor, click the Dynamic Sources icon at the top right corner > Select the appropriate field from the list> click “Insert“.
Adding metafields to a product page on Shopify using the theme editor

Video explanation

Wrap Up

It’s simple to add a metafield to a product in Shopify. Ensure you add as many fields as necessary so your customers have detailed information to help them make informed decisions when buying your products.

Remember, details also improve your customers’ shopping experience, which may motivate them to buy your products. Ultimately, you’ll increase your store’s bottom line and have a sustainable business.

Read more