Ultimate guide on using metafield in Shopify for business owners

Ultimate guide on using metafield in Shopify for business owners

Boost_Commerce
Shopify Partner
31 0 24
Boost_Commerce_0-1638240610437.png

 

Metafield is one of the most used features in Shopify but it is quite complicated for regular users to implement.

If you look at the documentation on Shopify Help Center, it suggests hiring a professional web developer to successfully add or display metafields.

It is inconvenient, isn’t it?

If you, a small business owner, are struggling to save every penny for your business, or don’t have time to deal with recruitment, then this article is definitely for you.

Just 10 minutes and you will know how to use metafields in Shopify by yourself.

What is a metafield?

Metafields (or custom fields) help you put extra information on your store which doesn’t include in Shopify basic configuration.

For example, you want to specify where the product’s origins are, or add downloadable manual pdf for your product, etc. These things will need you to use metafields.

To create a metafield product, you have to fill out the required information below

  • Namespace - A grouping of metafields to prevent conflicts.
  • Key - The metafield name.
  • Value - the value assign to each products and will show in the frontend
  • Description (optional) - to make others understand what is the meaning of the metafields.

Type of Metafields

In Shopify, there are 2 types of metafields you can use right now. (update Nov 2021)

1. Shopify Product Metafields

This is the most common one. It helps us show additional information for each product on the product page.

For example, proper use of metafields can help you show tech specs like this electronic store:

Boost_Commerce_1-1638240610445.png

 

Source: satechi.net

2. Shopify Variant Metafields

This type of metafields helps Shopify users add extra information for each variant of the products.

The picture below is an example of how you can use variant metafields: with each color variant, there will be different information in the bike’s parameters.

Boost_Commerce_2-1638240610457.png

 

Source: amazon.com

Other than these 2, Shopify indicates that they will have configurations for Collection, Customers, and Order metafields in the future.

How to use metafields in Shopify?

Note: these instructions were demonstrated on Debut themes. For any other themes, the steps are the same.

Step 1: Create the metafield definition

To create metafields using Shopify configuration, use the following steps:

1. Go to Setting > Metafields
2. Choose Metafields type. In this guide, we will choose the “Products” metafields type for demonstration.

Boost_Commerce_3-1638240610462.png

 



3. Click Add Definition
4. Fill in name, namespaces, key, and choose content type. Description is optional

Namespace & Key: as explained above, the namespace is like naming your folder, and key is the metafields name. Separate these 2 things by a full stop - “.”

Doesn’t matter which name, namespace, or key you choose, it won’t affect anything. Its only job is to help you manage and differentiate from other metafields.

In the example below: we use “my_fields” as namespace and “condition” as key.

For the content type, it decides the format of the meta fields value. In this example, we choose “text” format. With each format, there are further options for you to configure, but it is optional.

Boost_Commerce_4-1638240610471.png

 

5. Hit Save to successfully create one metafield definition.

Note:

  • Shopify requires you to pin the metafield (top right corner in the image above) to make it work. When you create a new one, it's pinned by default.
  • If you use 3rd-party Shopify Metafield apps, you can create new metafields definitions right on the app dashboard.

Step 2: Add value to the metafields in the product setting

Now, you need to add value to the newly created metafields in each product. You can do it in 2 ways:

  • Add metafields one by one
  • Add metafields in bulk

Add metafields one by one
1. In Shopify admin, go to Products > All products > choose the products you want to add more information through metafields.
2. On the product setting page, scroll down to the “Metafields” section.
3. Add Value to the Metafields.

Boost_Commerce_5-1638240610474.png

 

However, if you have a thousand products that need to add a metafield, this method could be very time-consuming. Therefore, we will guide you through on how to add metafields in bulk.

Add metafields in bulk

1. First, you need to type this URL format in your browser:

store-name.myshopify.com/admin/bulk?resource_name=Product&edit=metafields.{namespace}.{key}:{vaule_format}

Whereas you need to change {namespace}.{key}:{vaule_format} according to the metafieldscost-benefit definition you want to edit. All of this information you can take from the metafield definition you just made.

Continue with the example above, if we want to edit the metafields “Condition” in bulk, we have to enter the URL:

store-name.myshopify.com/admin/bulk?resource_name=Product&edit=metafields.my_fields.condition:text

2. After entering the URL, you will see the bulk editor screen (which is not accessible through the traditional way), now you can add value to multiple products at the same time.

Boost_Commerce_6-1638240610482.png

 

Although you still have to fill each value for each product, it's 100 times faster than going to each product and adding one by one.

Alternative option: you can consider using a Shopify App to bulk edit Metafields.

For example: “Metafields Guru” will help you edit the first 1000 products for free. However, bulk editing is a premium in every app, so you need to consider the cost-benefit analysis before deciding to buy one.

If you have more than 1000 or need to edit metafields in bulk multiple times, then using these apps is more reasonable.

Step 3: Display Metafields on your Shopify Store

With the release of Online Store 2.0, Shopify users now have 2 ways of showing metafields in the front-end:

  • Add code to themes (work with all theme versions)
  • Use theme editors (only available for OS 2.0 themes)

 

Following the example below, we will show you how to show metafields in product pages

Showing product metafields by adding code to themes

1. Go back to Metafields Setting, and copy/remembers this line, we will use it soon.

Boost_Commerce_7-1638240610494.png

 

2. Go to Online Store > Themes > Actions > Edit Codes
3. In the Section Folders, find product-template.liquid
4. Add the following code using the line we copy earlier in the suitable location in the template files,

In our example, it will look like this:

Condition: {{ product.metafields.my_fields.condition }}

Boost_Commerce_8-1638240610501.png

 

In the Debut theme, we add them right after the description and social share part, which you could identify by viewing briefly the code. However, you can add these lines anywhere on the product pages. If you don’t know where to add, just experiment with a few places and preview the front-end to see how it ends up.

5. Save, and check any product page for the results.

Boost_Commerce_9-1638240610518.png

 

Showing product metafields by using themes editors

Since this method only works for OS 2.0 themes, we will demonstrate it on the Dawn theme.

1. Go to Online Store > Products > Themes > In the current themes, choose Customize
2. Select Default Products Page or Product page template

Boost_Commerce_10-1638240610519.png

 

3. On the control panel on the left, in the Product Information panel > Add a Text block. You can drag the block to the location you want.

Boost_Commerce_11-1638240610542.png

 

4. Click on the Text block > click on the icon > add metafields.

Note: You need to add additional text before the block metafield to give the metafieldsFollowing a title.

Boost_Commerce_12-1638240610629.png

 

5. Hit Save and you are done. Do the same way to add another metafield..

Shopify metafields in practical use

Show addition information in an appealing style

This is the core functionality of metafields, a port to help shop owners add information that doesn’t have a place in Shopify to the product page. With the help of experienced web developers, you can have an appealing interface to display all information like showing in tabs, image slides, …

This will give customers a better shopping experience. And better shopping experience always leads to a better conversion rate.

Boost_Commerce_13-1638240610736.png

 

Filter, site search, and sort option by Metafields

Filter or search by metafield is one of the most popular features when people are looking for Filter & Search Shopify App.

With metafields and an app that supports this feature, your customer can find almost anything in your store faster through any information on your products.

Let’s take a look at this furniture store, they have a filter to help customers find products with storage ability or not. This product’s attribute is done efficiently when using metafields rather than tags or the product description.

Boost_Commerce_14-1638240610663.png

 

Final words

Learning to use metafields in Shopify may be complicated. However, if it is done correctly, it can help you in many important aspects of your eCommerce store: show additional information, use in filter and search, or product management.

We hope after this article, you have learned how to use metafield in Shopify.

If you have any questions, don’t hesitate to reach out to us through the contact page.

Subscribe to our email or follow us on Facebook, Twitter or Linkedin now for more valuable Shopify news, tutorials as well as eCommerce’s growth hacks to boost your business.

-----

Boost Commerce is a technology company that is helping more than 12,000 Online Stores Across 80+ Countries grow sales with Shopify Advanced Filter and Search app.

Product Filter & Search by Boost Commerce
#1 Product Filters & Search for brands of all sizes
---------------------------------------------------------------------
Insights of eCommerce Filter & Search for 2022 - Best Practices from Top Shopify Stores
Reply 1 (1)

KMFG_NYC
Visitor
1 0 0

Thanks for this breakdown, it's super helpful! One quick question: Where do you find the {value_format} portion of a metafield definition in order to complete the bulk editing URL? Look forward to hearing from you & thanks again for your help!