Shopify metafields: Everything you need to know for Shopify 2.0

Shopify merchants now have a variety of options for enhancing their store design and the shopping experience for their customers thanks to the new version of the Shopify Store, known as Online Store 2.0. You may create your own web page layouts for items, collections, blogs, etc. as a shop owner. Also, you can define your own metafields to display unique store material.

You will discover how to build Shopify metafields and show metafield values in your store in this article. Additionally, learn how to show photos on your site using Shopify metafields.

>>> Read also:

Shopify blog: The cost – effective way to promote your Shopify store organically

Shopify locations: How to create and use them to manage inventory for your Shopify store

How to create and deactivate the manual payment method for your Shopify store

What is a metafield?

Metafields or custom fields allow you to customize the functions and appearance in order to show more information on your online store. You can show customized information in a number of ways or utilize metafields for internal tracking. 

For example, you might want to add a pdf manual that customers can download for your goods, or you might want to mention the product’s origins. This is when you need to use metafields for those items. 

To create a metafields product, you must provide the necessary data below.

  • A namespace is a collection of metafields used to avoid conflicts.
  • Key: The name of the metafield.
  • Value – Each product’s allocated value is displayed in the frontend.
  • To help people understand the significance of the metafields, provide a description (optional).

Custom Fields of Metafield

1. Shopify Product Metafields

shopify-metafields1

Shopify Product Metafields is the most typical one as sellers can display more details about each product on the product page. 

For instance, using metafields properly may allow you display technical specifications like this electronic store:

2. Shopify Variant Metafields

shopify-metafields2

Shopify vendors may add further details for each product version with the use of Shopify Variant Metafields. 

In the image below, the characteristics of the chair will change depending on the color variation. 

3. Shopify Collection Metafields

shopify-metafields3

With the recently announced kind of metafields, retailers may become more creative with their collection sites.

The extra details of a sale promotion are a great illustration of this. To generate a sense of urgency, you may add a Metafields definition for the sales information and another one for the countdown timer.

4. Shopify Customer Metafields

shopify-metafields4

You can create customer segments based on unique and specific customer details with the help of metafields for customer information.

Use the following customer segments based on metafields as filters:

  • Send tailored emails to groups of clients, such as those who have recently viewed a certain product.
  • Customers should be reminded to evaluate their orders by seeing reminders on account sites.
  • Create layers of loyalty to divide discounts.

5. Shopify Order Metafields

You may now utilize Shopify Order Metafields in place of a third-party software in all of these situations and more.

The most recent version of Online Store 2.0 allows you to create metafields for Shopify Pages, Shopify Blogs, and Shopify Blog Posts.

shopify-metafields5

Metafields List

6

To put it simply, this is an upgrade since Shopify now permits metafields to contain a list of values rather than a single value as they previously did. But not all content kinds are compatible with this update.

Color, Date/Date & Time, Dimension, Weight, Volume, Number, Rating, Product reference, File reference, Page reference, URL, and Text are among the Shopify metafield content categories that take list values.

When selecting the allowed content types, a small checkbox for the following list of values will appear.

7

Metafield lists can be used for numerous effective purposes, including:

  • Use the Product reference metafields to add a Frequently Bought Together section to the Product page to upsell and cross-sell.
  • Include well-known sections like the size and policy pages with metafields for page references
  • Using Text metafields, create a list of ingredients for a recipe.
  • Insert vital files into file reference metafields for clients to download.

Metafield Limit

Shopify now permits businesses to establish up to 200 metafield definitions.

There were only 100 metafield definitions that Shopify firms could add when it first launched. Shopify just increased the cap to 200.

We believe that this quantity will suffice for SMBs. To save and manage your metafields, you might require a third-party tool if you are managing a megastore with a sizable inventory.

How to use metafields in Shopify

Step 1: Create the metafield definition

Use the below steps to build metafield using Shopify configuration:

  1. Select Setting > Metafields.
  2. Select the Metafields type. We will demonstrate the “Products” metafields type in this guide.
8
  1. Select Add Definition.
  2. Select the content type and provide the name, namespaces, and key. Description is not required.

Namespace & Key: As previously mentioned, the namespace functions as the folder name, and the key is the name of the metafields. Put a full stop (“) between these two items.

No matter what name, namespace, or key you select, nothing will change. Its sole purpose is to support you in managing and standing out from other metafields.

The namespace “my fields” and the key “condition” are used in the example below.

The format and value of the metafields are determined by the content type. For this illustration, we opt for the “text” format. There are other configuration choices available for each format, but they are not required.

9

5. Click Save to finish creating a single metafield definition.

Note: 

For the metafield to function properly on Shopify, you must pin it (upper right corner in the image above). It is already pinned when you make a new one.

If you utilize a Shopify Metafield app from a third party, you may add new definitions for metafields right from the app’s dashboard.

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

The newly formed metafields in each product now need to be enhanced. There are two methods to do it:

  • Add metafields separately
  • Add metafields in bulk

Add metafields separately

1. In Shopify admin, select Products > All items > select the products to which you want to add metafields for more information.

2. Locate the “Metafields” section on the product settings page by scrolling down.

3. Add the Value to the Metafields.

10

This solution might be quite time-consuming, though, if you need to add a metafield to thousands of goods. We will thus walk you through the process of adding metafields in bulk.

Add metafields in bulk

  1. Start by entering the following URL format in your browser:

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

You must modify {namespace}.{key}:{vaule_format} in accordance with the name space & key specification of the metafield you wish to update. The metafield specification you just created can be used to derive all of this knowledge.
Keeping with the previous illustration, we must input the following URL in order to change the metafield “Condition” in bulk:

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

2. You will see the Bulk editor page (which is not available through the conventional approach) after inputting the URL. Now you can add data to numerous items at once. 

11

It’s considerably quicker than going to each product and adding value separately, even though you still have to fill the value for each item.

A Shopify App might also be used to bulk modify Metafields.

For instance, Metafields Guru will provide free editing assistance for the first 1000 products. Before choosing to purchase an app, you should take into account the cost and usefulness to your business as bulk editing is a premium function in every app.

Using these applications is more sensible if you need to modify metafields in mass several times or have more than 1000 goods.

Step 3: Display Metafields on your Shopify Store

With the launch of Online Store 2.0, now Shopify vendors can show metafields in the front-end in two ways:

  • Adapt theme editors (only available for Online Store 2.0 themes)
  • Add code to themes (available for all theme versions)

Showing product metafields by adding code to themes

1. Return to the Metafields Setting page, copy or save this line for later use. 

12

2. Open Online Store > Themes > Actions > Edit Codes

3. In the Section folders, locate product-template.liquid

4. Add the code that is similar to the one below:

13

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

5. Press Save and check any product page to see the outcomes.

Deleting the Shopify 2.0 Metafields

You can remove a metafield from your shop if it is no longer in use. The Shopify 2.0 metafields may be deleted quickly and easily in two ways:

Delete definition and all metafield values

You will be able to do this to delete the metafield and all of its related values. To make sure it is not related to any blocks or sections in your current theme, you must verify before selecting this option to delete your metafield.

Delete definition only

14

The value of the metafield definition will still be there on the online store even when you delete it from your store. You can discover some mistakes in your theme editor after using this option to remove the metafield definitions.

If you have any further metafield errors in your Shopify store, you may be able to discover a solution in the guide to correcting metafield errors or you may be able to find alternative ways to receive support for the problems.

Steps to delete metafields from your store

  • Step 1: Navigate to Settings > Metafields in your Shopify admin.
  • Step 2: Select the metafield, such as Size Chart, that you wish to delete from your Shopify store.
15
  • Step 3: Hit the Delete button. 
16
  • Step 4: Choose Delete definition and all metafield values from the deleting options.
17
  • Step 5: Delete the metafield from your store forever.

Final words

It could be challenging to learn how to use metafields in Shopify. However, if you do it properly, it may assist you in many crucial areas of your eCommerce site, such as product administration, providing more information, and employing filters and search. We hope that after reading this post, you now understand how to use Shopify metafields. Besides offering informative posts about Shopify, we provide excellent Shopify customization services, including . Magesolution has helped hundreds of businesses to build and modify their Shopify stores to meet the high requirements from their customers. Feel free to CONTACT US right now!