How to Create Product Metafields in Shopify: A Step-by-Step Guide
Last updated
Last updated
Metafields in Shopify allow you to save specialized information that isn't typically captured in the Shopify admin. They can be used to customize the functionality and appearance of your store. Here’s a quick overview of how to use metafields.
Add Custom Information:
Store details like product specifications, care instructions, or any other relevant data that enhances your product pages.
Display on Storefront:
You can choose to display metafields on your online store, making it easier for customers to find important information.
Internal Tracking:
Use metafields for internal purposes, such as tracking product details or customer preferences.
Create a Product Metafield Definition:
Go to your Shopify admin > Settings > Custom data > Product. Here, you can add a new definition for your metafield.
Click Add definition. Enter a Name and a Namespace and Key for your metafield (e.g. Origin
, custom
).
Select the appropriate data type.
Select the number of values for the metafield.
There are two options:
One value: If you select this option, in Step 2 (Add value), you can only enter a single value.
List of values: If you select this option, in Step 2 (Add value), you will be able to enter multiple values.
Assign to specific categories (Optional) . This allows the metafield to appear only on products belonging to certain categories.
Add validation rules (Optional). Use validation to limit accepted values (e.g. only allow numbers from 1 to 5).
Click Save
Add Values:
One value
After creating a definition, you can add values to your metafields for specific products.
List of values
If you have defined the metafield as a list of values, you can enter multiple values at this step by clicking the Add item button.
đź’ˇ Tip: Variant metafields are created similarly to product metafields. Just make sure to select Variant as the resource type before defining your metafield.
You can use metafields as a condition to determine which products will display labels or badges. With the BSS: Product Labels & Badges app, you can easily set these conditions based on the metafield values for your products.
For more details on how to use metafields as conditions for displaying labels/badges, check out the following article: How to Use Product Metafields to Customize Label/Badge Display?