Website Building » Shopify » How Do I Add Metafields to Shopify Without App?

How Do I Add Metafields to Shopify Without App?

Last updated on October 1, 2022 @ 9:03 pm

There are two types of Metafields in Shopify. One is for products and the other is for collections. To add a metafield to a product:

From your Shopify admin, go to Products. Click the name of the product that you want to add a metafield to. In the Product Details section, click More actions > Edit code. In the Templates directory, click product.liquid. Find the Add new metafield button, and then click it. In the Add Metafield window, enter the following information:
In the Namespace field, enter a namespacing prefix to avoid conflicts with other metafields from other apps. For example, if you’re adding metafields for an app called “Best App Ever”, you might namespace your metafields “best-app-ever”.

In the Key field, enter a name for your metafield. This is typically a short description of what the metafield contains. For example, if you’re adding a metafield for an app called “Best App Ever”, you might name your metafield “best-app-ever-is-awesome”. In the Value field, enter the information that you want to store in your metafield. This could be anything from a short text string to a large block of HTML code. In the Value Type drop-down menu, choose the type of data that you’re storing in the Value field. The options are: String, Integer, JSON
Click Save.

To add a metafield to a collection:

From your Shopify admin, go to Products.

Click Collections.

Click the name of the collection that you want to add a metafield to.

In the Collection Details section, click More actions > Edit code.

In the Templates directory, click collection.

Find the Add new metafield button, and then click it.

In the Add Metafield window, enter the following information:
In the Namespace field, enter a namespacing prefix to avoid conflicts with other metafields from other apps.
In the Key field, enter a name for your metafield.

For example, if you’re adding a metafield for an app called “Best App Ever”, you might name your metafield “best-app-ever-is-awesome”.
In the Value field, enter the information that you want to store in your metafIELD.
In teh Value Type drop-down menu, choose teh type of data that you’re storing in teh Value field. The options are: String, Integer, JSON
Click Save.

PRO TIP: Adding metafields to Shopify without an app can be tricky and may result in unexpected behavior. If you are not careful, you may end up with duplicate or missing data.
Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.