Metafields in Shopify

Metafields in Shopify

With the most recent of Shopify, Online Store 2.0, Shopify merchants have got more options to improve the look and feel of their store and enhance the shopping experience of the customers.

Being a Shopify store owner, you can build your page templates for products, orders, blogs, collections, and more. If you want to show some customized content on any of your pages, you can use metafields to define your requirements.

In this blog, we’ll cover everything related to Shopify metafields. Within a matter of few minutes, you’ll get to know about metafields, and how you can add metafields in your Shopify store.

So, let’s start!

What are Metafields in Shopify?

The Shopify metafields help you place additional information about your offerings, variants, blogs, orders, collections, and many more in your online store. For instance, you need your visitors or customers to see a user manual for the products on the product page.

Well, Shopify offers data storage in the admin panel, but that’s common for all Shopify stores. And, if you wish to add unique data about your products or any object, you can do so by Shopify Metafields.

After you create metafields, you can add them to your product page, collection, customers, or orders page and use them for customizing the design of your Shopify store.

When you create a metafield, you will have to enter the below-mentioned information:

  • Namespace: It’s a way of grouping the metafields to prevent conflicts.
  • Key: It’s the name of metafield.
  • Value: It is the value assigned to each product that shows in the frontend.
  • Description: It helps others understand the meaning of metafields. 

Shopify Metafields Namespace & Key

What’s New in Shopify Metafields?

Earlier, one couldn’t find any inbuilt metafield feature in Shopify. To insert one, we had to use liquid code or either way install a third-party app to add and manage the metafields in the store.

Creating metafields with the help of Shopify liquid code isn’t an easy task, and thus, a non-tech-savvy individual needs to hire developers to create metafields.

With the newer version of Shopify, an inbuilt metafield feature in Shopify’s store admin allows you to create metafields without any technical knowledge. Thus, you don’t have to spend an extra penny on hiring developers or purchasing third-party Shopify apps for metafields. 

Custom Fields of Metafields in Shopify

In Shopify, there are 8 custom fields of metafields that you can take benefit of:

1. Shopify Product Metafields

This is one of the most common metafields in Shopify that is used to display additional information for each product on the product page.

For instance, with the help of Shopify product metafields, you can show product detailed descriptions like this clothing store.

Shopify Product Metafields

2. Shopify Variant Metafields

This particular type of metafield allows Shopify merchants to add extra information for each variant of the products.

For example, the below-mentioned example shows color variants available for a beauty product in a cosmetic store.

Shopify Variant Metafields

3. Shopify Collection Metafields

This is one of the newly released types of metafields that allows Shopify merchants to create an appealing look on their collection pages.

For instance, you can add a metafield to your store to give filters and sort options about the products. The use of collection metafields can help you display Filter by Print like this in a clothing store.

Shopify Collections Metafields

4. Shopify Customer Metafields

Customer metafields are a great way to show customer segments based on custom and specific customer details.

You can use them to:

  • Send targeted emails to specific customers
  • Showcase reminders to customers to review their orders

For example, in this image, you’ll see a list of items that a customer has marked as favorites. They will be able to view their favorites on their account.

Shopify Customers Metafields

5. Shopify Order Metafields

Sometimes, as the need arises, you need to add some extra information for your store orders. Some of the cases are:

  • Show ratings to the orders
  • Add remarks to the orders
  • Display orders as normal or express delivery

For instance, here you’ll find the order marked with Express Shipping. This can be achieved through Order metafields.

Shopify Orders Metafields

In the same way, you can make use of Shopify metafields for pages, blogs, and blog posts.

How to add metafields in Shopify?

Are you ready to expand your Shopify store? If yes, you can edit your store’s content with metafields. All credit goes to the inbuilt Shopify metafields! It allows you to add metafields to your store and use them anywhere to customize your online store.

You can learn to create metafield, add values to it, and show them on your Shopify store based on the types:

To create metafields, first, you need to define them.

Defining the Shopify Metafields

By defining Shopify metafields, you mean to create an attribute that holds some value. The Shopify definition ensures at all the values you add to the metafields are of apt formats such as numbers, content, image, link, and more.

Currently, Shopify offers two different metafield definitions, which are:

  • Standard Metafield Definition: In this, Shopify has given some metafield definitions that work well with all the Shopify apps, themes, and the areas in your store where you want to place them.
  • Custom Metafield Definition: If you want something out-of-the-box for your store, you can create a custom metafield definition based on your needs and requirements for your store and use it wherever you want.

Steps to Add Metafield to Shopify

Step 1: From your Shopify store admin panel, click on Custom Data and then go to Metafields.

Shopify metafields

Step 2: Next, choose and click the part of the store you want to add a new field, for instance, products.

Shopify Choose Metafields

Step 3: Click on Add definition.

Add definition in Shopify metafield

Step 4: Next, type the Name of the product metafield (for instance, Design 2). If you want to add a description to the metafield, you can add it from here, but that’s optional. Then, click on Select content type.

Add product name and description

Step 5: Select the most preferred content type for your product metafield and click on Save.

select content type

Step 6: As you click on save, you’ll see your metafield being added to the list.

product metafield definitions

How to Display the Metafields on Your Shopify Store?

Follow the steps mentioned below to display the metafield in the product pages:

Step 1: Go to Online Store > Themes > Actions > Edit Code.

Shopify Edit Code

Step 2: In the Sections folder, you need to search for main-product.liquid.

Shopify search product section

Step 3: Next, add the code of the metafield to a suitable location in the product file.

In our example, the code will be:

{{product.metafields.custom.design2}}

Save the Changes!

Shopify code for metafield

Step 4: Next step is to enter the text into the metafield that we just created. For that, navigate to the Products. Select the product that you wish to add metafield to.

Shopify products

Step 5: Scroll down the product page and enter the text to the created metafield and click on Save.

Shopify edit metafield

Result:

Refresh the product page to see the results.

Shopify metafield result

How to Bulk-Edit Shopify Metafields?

If you wish to bulk-edit Shopify metafields all in one place, follow the below-mentioned steps:

Step 1: From your Shopify store’s admin panel, go to Products.

Shopify Products

Step 2: Click the box and select all the products. Next, click Bulk Edit.

Shopify Products Bulk Edit

Step 3: You’ll see a table of all products displayed in front of you. Here, you need to click on the Columns that you’ll find in the top right corner.

Shopify Bulk Edit Product Columns

Step 4: Scroll down until you find metafields in the list. Select any or all metafields that you wish to add to your products.

Shopify Bulk Edit Metafields

Step 5: To edit the metafields, click on the text field area.

Shopify Edit Metafields

Step 6: Once you’re editing the metafields, click on the Save button.

Shopify Bulk Edit Metafields Save

How to delete metafields in Shopify?

If a metafield you created earlier is no longer in use to you, and you wish to delete it from your store, you can do so in two easy ways:

  • Delete definition & all metafield values: This way will enable you to delete or remove the metafield with all its values. But, before you go for this, ensure that it isn’t connected with any of the sections of your store.
  • Delete definition only: This way will only delete the metafield definition and its associated values will remain on your store. After you remove metafield definitions, chances are you may find some errors in your theme editor. You may find its solution in Shopify’s metafield error fixing guide.

Steps to Delete Metafield in Shopify

Step 1: From your Shopify store admin panel, click on Settings and then go to Metafields.

Shopify Metafield Settings

Step 2: Next you need to click on the metafield that you want to delete from your store, for instance, Design.

Shopify Metafield Select

Step 3: Now as you scroll down, you’ll find a Delete button. Simply click on it.

Shopify Metafield Delete button

Step 4: Next, you need to choose anyone from the delete options and click on the Delete button to remove the metafield from your Shopify store.

Shopify Metafield Delete

Practical Use Cases for Shopify Metafields

Below are some practical use cases for metafields in Shopify:

  • Custom Product Fields: Metafields in Shopify can be used to store additional information about the products you may be offering such as weight, dimensions, custom attributes, or materials that default Shopify doesn’t offer. This can be especially useful if you sell complex or unique products.
  • Product Variants: Metafields can also be used to store additional information about product variants, such as SKU numbers, prices, or even custom images. This can help you organize the products in your store more systematically, and hence, provide more detailed information to your customers.
  • Customizing the Storefront: Metafields can be used to add custom information to your storefront, such as a banner image, custom CSS, or even a unique favicon. This can help you create a personalized shopping experience for your customers according to their needs, preferences, and demands.
  • Custom Fields for Customer Profiles: Metafields can be used to store additional information about your customers, such as their preferred language, shipping address, or even custom notes about their buying habits. This can help you understand your customers better and create marketing strategies accordingly.
  • Order Notes & Tracking: Metafields can be used to store order notes or tracking information, such as the shipping carrier, tracking number, or delivery date. This can help you keep track of your orders and thereby offer better customer service.

Wrapping Up!

Learning how to add, manage, or delete metafields in Shopify can be complex. However, if you start from the basics (which we’ve tried to cover in our blog) can help you with the crucial aspects of your online store like showing more or additional information on the store pages.

We hope after going through this blog, you would have learned what metafields are and how to use them in your Shopify store.

If this blog proved to be helpful for you, don’t forget to tell us in the comments section and share our blog amongst your friends and groups.

If you have more queries or doubts regarding metafields, reach out to us, and we’ll be happy to guide you!

FAQ

1. How does Metafields work on Shopify?

Metafields are custom data fields that you can add to Shopify products, collections, customers, orders, and other resources. They can be used to store any kind of information, including order notes, client preferences, and product specifications.

Metafields can be used to:

  • Customize the look and feel of your store. For example, you could use metafields to display a product’s weight or dimensions or to show a customer’s preferred shipping method.
  • Segment and target your customers. You can use metafields to segment your customers based on their interests or purchase history.
  • Automate your business processes. For example, you could use metafields to automatically send a customer an email when their order is shipped.

2. Is there a metafield limit in Shopify?

Yes, there is a metafield limit in Shopify. You can have up to 200 metafields for each resource type.

3. Which is the best Shopify metafield app to add custom metafields?

You can easily find many apps on Shopify app store for adding custom metafields to your store. But, one of the best Shopify metafield app that you can use for your store is Metafields Guru.

4. How do I access metafield in Shopify?

You can access metafield in Shopify through:

  • Go to the Shopify Admin
  • Click on Settings
  • Click on Custom Data
  • Select the metafield you want to access

5. Why is my metafield not showing in Shopify?

There are a few reasons why your metafield might not be showing in Shopify. Here are a few things to check:

  • Make sure the metafield is enabled.
  • Make sure the metafield is associated with the correct object.
  • Make sure the metafield is visible to the public.
  • Make sure the metafield is being rendered correctly in your theme.