Unlock the Power of Metafields: A Comprehensive Guide to Customizing Your Shopify Store

Odemkněte sílu Metafields: Komplexní průvodce přizpůsobením vašeho obchodu na platformě Shopify

💡 I. What is a Metafield

💡 Metafields in Shopify are custom fields you can use to add extra information to products, collections, customers, orders, blogs, and pages. They give store owners extra functionality and flexibility when they need to include information beyond what's possible in Shopify's standard interface.

💡 There are many different ways to work with metafields and interact with them. It can be confusing at first, but by following this simple guide, I'm confident you'll quickly learn how to work with them! Let's get started!

🍋 II. Where to find metafields and how to edit them

🍋 First, let's look at one type of metafield as a case study. We'll walk through what you'll need to set up, and how you can use it. Then I'll give you a few examples of how you can use this creative feature!

Starting point - Go to settings

Go to Settings - Custom data - Metafields and select the one you want to work with. I chose "Products", because I wanted to add a field to my products.

Here, enter a suitable name for your field. This creates the namespace and key (more on that later). In the description, define what this metafield will be used for, and then select the metafield type you want to work with. Careful! Once selected, it can't be changed later.

Here's a list of all the field types you can choose from for products:

Now let's look at how you can actually add your metafield to your product. Again, it's pretty simple. Within your product's information, add an 'Extensible' block. You can give it whatever name you like (in my case it was 'Quick spec'), choose a suitable icon, and in the 'Text' field select the icon in list form. All existing metafields will show up here for you to choose from.

Once it's inserted and saved, it will display on your website something like this (depending on your theme, of course).

While we've talked a lot about product metafields, it's important to note that you can also add metafields to variants and to your entire store. Variant metafields can hold additional information about a specific product variant. This can be extremely useful for managing and displaying variant-specific data, such as dimensions, materials, or any other specifications that may differ between individual variants. On the other hand, store metafields can hold information about your entire store, such as opening hours, policies, special announcements, and more.

Now that you know this simple example you can use for your products, and something basic about variants, let's look at a few more use cases that can occasionally feel like real magic! 💫

🪄 III. Creative ways to use Metafields 🪄

Without trying to find a complete list of use cases, I'd like to show you a few creative ways you can use your metafields:

1. 🧸 Product personalization

If you sell customizable products, you can use metafields to store customer input. For example, for a T-shirt, you could use a metafield to store a custom message the customer wants printed on it.

2. 🧾 Additional product details

You can use metafields to store additional product information, such as detailed specifications, links to videos, size charts, PDF user manuals, or other details that don't fit into a standard product description - that's what we did in our first use case above 😉

3. 🔎 Enhanced SEO

Metafields can hold additional SEO-related information that can be used to enrich product and collection pages. For example, you can store a secondary title, meta keywords, or a longer description that's visible only to search engines.

4. 📎 Social media links

If you want to include specific social media links or shareable content on your product or collection pages, you can store this information in metafields and then use it in your design.

5. 📍 Store locator

If you also run brick-and-mortar stores, you can use metafields to store information about those locations, such as addresses, opening hours, or in-store promotions.

6. 🦄 Custom icons or badges

Metafields can store the image URL for a badge (e.g. "Bestseller") or an icon symbolizing something unique about the product (e.g. "Gluten-free").

7. 👁️ Advanced filtering

Use metafields to enable more granular product filtering by material, feature, or any specific attribute relevant to your products. Again, in some themes this is very easy to implement. You can use the free Search & Discovery app for this, which enables this functionality for your store and its use of metafields.

8. 📄 Vendor information

If you sell products from different vendors, you can use metafields to store and display additional information about each vendor.

9. 👥 Customer segmentation

Metafields can be used to store additional customer information that can be used for segmentation, personalized marketing, or unique customer experiences.

10. ✒️ Storing blog post authors

If you have multiple authors for your blog, you can store their names and bios in metafields and display them on each post.

+1 ⚠️ A word of caution

It's important to remember that metafields are widely used by many Shopify apps to store additional data. It's usually best to leave metafields created and managed by apps untouched, since editing them could affect the functionality of the apps that depend on them.

Besides the uses we've already discussed, it's worth noting that Shopify itself uses metafields in various interesting ways. For example, it stores data for product recommendations using metafields. This enables a personalized shopping experience, since Shopify can suggest similar or complementary products to customers based on their browsing and purchase history.

And finally, depending on your theme, some of the creative ways to use Shopify metafields I've suggested above will likely require some custom code to integrate the metafield data into your store's theme. That's because Shopify's default themes and settings don't automatically support or display metafields. On the other hand, if you've purchased a theme that includes some of these features, you may be able to avoid custom code entirely.

If your theme doesn't support some of the functionality mentioned above, here's a simple list of ideas for how you can still integrate them into your store using custom Liquid snippets:

Product personalization: You'll need to build a system that collects customer input, stores it in metafields, and then accesses those metafields when fulfilling orders.

<input type="text" id="custom-input" name="properties[Custom Message]" />

Additional product details: Adding extra product information requires editing your theme's product templates to display data stored in metafields.

<p>{{ product.metafields.global.extra_info }}</p>

SEO improvements: Implementing additional SEO-related metafields requires edits to your theme's code, especially in the page header and possibly in schema data.

<meta name="description" content="{{ product.metafields.seo.long_description }}">

Social media links: You'll need to add code to your product or collection templates that pulls social media links from the metafield and displays them appropriately.

<a href="{{ product.metafields.social.facebook_link }}">Facebook</a>

Store locator: If you want to use metafields for store information, you'll need to edit your theme to include a store locator feature that pulls data from metafields.

<p>{{ shop.metafields.store_info.store_address }}</p>
<p>{{ shop.metafields.store_info.store_hours }}</p><img src="{{ product.metafields.badges.icon_url }}" alt="badge" />

Custom icons and badges: To display these icons or badges, you'd need to add code to your product templates that loads and displays the image from the URL stored in the metafield.

<input type="text" id="custom-input" name="properties[Custom Message]" />

Vendor information: You'll need to edit your product templates so they display vendor information stored in metafields.

<p>{{ product.metafields.vendor_info.vendor_description }}</p>

Customer segmentation: Depending on what you're doing with customer segmentation, you may need to edit various parts of your theme and potentially create unique landing pages or email templates.

{% if customer.metafields.info.customer_type == "VIP" %}
    <p>Welcome, VIP customer!</p>
{% endif %}

Storing blog post authors: You'll need to edit your blog templates so they display author information stored in metafields.

<p>Author: {{ article.metafields.authors.author_name }}</p>
<p>Bio: {{ article.metafields.authors.author_bio }}</p>

In each of these examples, replace "global", "seo", "social", "store_info", "badges", "vendor_info", "info", and "authors" with the namespace you used for your metafields, and replace "extra_info", "long_description", "facebook_link", "store_address", "store_hours", "icon_url", "vendor_description", "customer_type", "author_name", and "author_bio" with the keys you used.

🔎 Remember, these are very basic examples 🔎

Depending on your specific use case, theme, and how you've set up your metafields, you may need to adapt these examples to fit your needs. If you're not sure, it's best to work with a developer - maybe with us at Sounds Good Agency 😉.

Besides reaching out for our help, there are also many apps that can make creating and managing your metafields easier, such as:

  • Metafields Guru: Metafields Guru is a Shopify app that provides a user-friendly interface for adding, managing, and configuring metafields in your Shopify store. It lets you extend Shopify's standard functionality to store additional information directly related to your products, collections, orders, and more.
  • Matrixify: Matrixify is a powerful Shopify app designed to simplify bulk importing, exporting, and updating data. It supports various data types, including products, collections, customers, orders, and even metafields, making it a versatile tool for managing your Shopify store.

When using apps that interact with metafields, remember to proceed carefully, since an improper edit to a metafield could disrupt the functionality of apps that depend on it.

Speaking of apps, I'd also like to mention one special one we built at Sounds Good Agency - the "Czech Names" app. This app harnesses the power of Shopify metafields to adapt to the specific grammatical nuances of the Czech language. For those unfamiliar, Czech grammar uses a declension system, meaning a noun's form changes depending on its grammatical context. "Czech Names" precisely adapts names according to this system, ensuring that personalized messages in your store are grammatically correct. This way, it not only improves localization, but also adds a more personal touch to the shopping experience. With simple setup and seamless integration, it's a useful addition for anyone trying to reach a Czech-speaking audience.

Share article

Contact us and kick-start your success on Shopify

First agency in CZ and SK