Unlock the Power of Metafields: A Comprehensive Guide to Customizing Your 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 that you can use to add extra information to products, collections, customers, orders, blogs, and pages. They provide additional functionality and flexibility for store owners who need to incorporate information beyond what is possible within the standard Shopify interface.

💡 There are many different ways you can work with and interact with Metafields. It may seem confusing at first, but by following this simple guide I'm confident you'll get the hang of it quickly! Let's dive in!

🍋 II. Where to Find Metafields and How to Edit Them

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

Starting Point - Go to Settings

Navigate 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 you enter a suitable name for your field. This will generate the namespace and key (more on that later). In the description, define what this metafield will be used for, then select the type of metafield you want to work with. Important! Once selected, it cannot be changed later.

Here is the list of all 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 quite straightforward. Within your product information, you'll add an 'Expandable' block. You can name it however you like (in my case it was 'Quick Specs'), select an appropriate icon, and in the 'Text' field select the list icon. All existing metafields will appear here for you to choose from.

Once inserted and saved, it will appear on your website similarly to what you see here (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 your entire store. Variant metafields can store 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. Store metafields, on the other hand, can contain 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 some basics about variants, let's look at additional use cases that can sometimes feel like pure magic! 💫

🪄 III. Creative Ways to Use Metafields 🪄

Without trying to compile an exhaustive list of use cases, I'd like to introduce you to a few creative ways you can leverage your metafields:

1. 🧸 Product Customization

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 extra product information such as detailed specifications, video links, size charts, PDF user manuals, or other details that don't fit into a standard product description — which is exactly what we did in our first use case 😉

3. 🔎 Enhanced SEO

Metafields can hold additional SEO-related information that can be used to enrich product and collection pages. For example, you could store a secondary title, meta keywords, or a longer description that is 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 operate brick-and-mortar stores, you can use metafields to store information about these locations, such as addresses, opening hours, or in-store special events.

6. 🦄 Custom Icons or Labels

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

7. 👁️ Advanced Filtering

Use metafields to enable more detailed product filtering by material, property, 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 to enable this feature for your store and take advantage of metafields.

8. 📄 Vendor Information

If you sell products from various 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 alongside each post.

+1 ⚠️ A Word of Caution

It's important to remember that when working with metafields, they are widely used by many Shopify apps to store additional data. Metafields created and managed by apps are generally best left untouched, as modifying them could affect the functionality of the apps that depend on them.

Beyond the uses we've already discussed, it's worth mentioning that Shopify itself uses metafields in various interesting ways. For example, it stores product recommendation data using metafields. This enables a personalized shopping experience, as 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 uses of Shopify metafields I've suggested above will likely require some custom code to integrate metafield data into your store's theme. This is 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 is a simple list of ideas for how you can still integrate them into your online store using custom Liquid snippets:

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

Additional Product Details: Adding extra product information requires modifying product templates in your theme to display data stored in metafields.

{{ product.metafields.global.extra_info }}

SEO Enhancement: Implementing additional SEO-related metafields requires modifications to your theme code, particularly in the page header and possibly in schema data.

Social Media Links: You'll need to add code to product or collection templates that retrieves social media links from a metafield and displays them appropriately.

Facebook

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

{{ shop.metafields.store_info.store_address }}

{{ shop.metafields.store_info.store_hours }}

badge

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

Vendor Information: You'll need to modify product templates to display vendor information stored in metafields.

{{ product.metafields.vendor_info.vendor_description }}

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

{% if customer.metafields.info.customer_type == "VIP" %}
    

Welcome, VIP customer!

{% endif %}

Storing Blog Post Authors: You'll need to modify your blog templates to display author information stored in metafields.

Author: {{ article.metafields.authors.author_name }}

Bio: {{ article.metafields.authors.author_bio }}

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.

🔎 Keep in Mind That These Are Very Basic Examples 🔎

Depending on your specific use case, theme, and the way you've set up your metafields, you may need to adapt these examples to suit your needs. If you're unsure, it's best to work with a developer — like us at Sounds Good Agency 😉.

Beyond seeking our help, there are 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 allows you to extend Shopify's standard functionality by storing additional information directly related to your products, collections, orders, and more.
  • Matrixify: Matrixify is a powerful Shopify app designed to simplify the process of 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 Shopify store management.

When using apps that interact with metafields, remember to proceed with caution, as improper modification of metafields can disrupt app functionality.

Speaking of apps, I'd also like to mention one special app we developed at Sounds Good Agency — the "Czech names" app. This app leverages 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 the form of a noun changes depending on its grammatical context. "Czech names" accurately adapts names according to this system, ensuring that personalized messages in your store are grammatically correct. In this way, it not only improves localization but also enhances the personal touch of the shopping experience. With simple setup and seamless integration, it's a useful addition for anyone looking to reach a Czech-speaking audience.

Share article

Contact us and kick-start your success on Shopify

First agency in CZ and SK