Shopify – Custom Data  [Comprehensive Guide]

The Shopify platform has built-in data models covering basic commerce concepts such as products, collections, customers, and orders. If you need more advanced or specific data models, Shopify custom data can help you extend Shopify’s data models. You can create your data models using the available resources. Includes data models for fundamental commerce concepts such as products, collections, customers, and orders. If you require more complex or specific data models, Shopify custom data can help you extend Shopify’s data models and create your own using the following resources.

Metafields

It defines and associates a custom or standard field with different parts of Shopify, such as products, customers, or blogs.

For example, if you have an apparel store and want to add care instructions for your products, then you might add a metafield to the product called “Care instructions.” You can then add specific care instructions for one or all of your products.

Metaobjects

It defines and creates custom data structures with Shopify.

For example, if you have a beauty and skincare store and want to capture and display information about your top influencers, then you might build a metaobject called an “Influencer profile”. Include fields for a headline, image, and description, then create entries for each influencer. Display this in your theme or only use it in your admin.

You can also have any meaningful name that is understandable for you to set up data in admin.

Types of Metafields

You can create the following types of metafields: those with standard or custom definitions.

Standard

These definitions are automatically configured for you and are designed to be universally compatible across Shopify. Because standard metafield definitions follow standards that are used across all Shopify stores, they’re supported by apps, themes, and other parts of your store. You can add product categories to your standard product metafields so that those metafields only display on products for the specific product category. 

Recommended Read: Shopify Custom PHP App

List of Standard Metafield Definitions

The following table describes the standard metafield definitions:

NameIDTypeDescriptionAllowed resourcesReserved namespace and key
Product subtitle1single_line_text_fieldStores a concise description of a product. All apps should use this metafield instead of the product’s full description when a brief product summary is needed. For example, SMS apps can use the product subtitle for short text messages about a product.

Maximum length: 70 characters
PRODUCT
PRODUCT VARIANT
descriptors.subtitle
Care guide2multi_line_text_fieldStores detailed instructions on how to take care of clothing. Themes aimed at users selling apparel can use this metafield for display on product detail pages.
Maximum length: 500 characters
PRODUCT
PRODUCT VARIANT
descriptors.care_guide
ISBN3single_line_text_fieldStores an ISBN book identifier. Themes supporting booksellers can use this method to identify books to customers. Apps helping to merchandise books should write to this metafield for optimal theme integration.
It should be a 10-digit or 13-digit number (with optional hyphens).
PRODUCT
PRODUCT VARIANT
facts.isbn
UPC4single_line_text_fieldStores a Universal Product Code (UPC). Apps reading or writing UPCs should integrate this standard metafield for display purposes, or integration with ERP systems.
It should be a 12-digit number with at least one zero.
PRODUCT
PRODUCT VARIANT
facts.upc
EAN5single_line_text_fieldStores a European Article Number (EAN). Similar to UPCs, apps reading or writing EANs should integrate this standard metafield for display in online stores, or integration with ERP systems.
It should be a 13-digit number.
PRODUCT
PRODUCT VARIANT
facts.ean
Product rating6ratingStores the average rating for a product or variant. Product rating apps should write to this standard metafield and should update this standard metafield whenever a product’s rating has changed. Themes displaying product ratings should reference the product rating for the aggregated average product rating (stored as a rating type).PRODUCT
PRODUCT VARIANT
reviews.rating
Product rating count7number_integerStores the total number of ratings for a product or variant. Product rating apps should write to this standard metafield and should update this standard metafield whenever a product’s rating has changed. Themes that display product ratings should reference the product rating count for the total number of ratings for a product (stored as a number_integer type).PRODUCT
PRODUCT VARIANT
reviews.rating_count
Related products14list.product_referenceStores products that are similar to a selected product. You can display potential substitutes to help customers discover other similar products they might like.PRODUCTshopify–discovery–product_recommendation.related_products
Related products setting15single_line_text_fieldStores a setting value that controls how manual product recommendations are displayed. Accepted values:
only manual: Display only manual recommendationsahead: Display manual recommendations before auto-generated recommendations
PRODUCTshopify–discovery–product_recommendation.related_products_display
Search product boosts16list.single_line_text_fieldStores search terms associated with a product. When a customer searches your store using the search terms, the product ranks higher in the search results.PRODUCTshopify–discovery–product_search_boost.queries
Complementary products17list.product_referenceStore products are often bought in addition to a selected product. You can display complementary products to help customers discover new products and increase online store sales.PRODUCTshopify–discovery–product_recommendation.complementary_products
Birth date19dateStores the customer’s date of birth in ISO 8601 format. Customers can have one birth date on record as part of their profile. You can use this metafield to create a filter that segments customers by birthday to send an automatic discount.CUSTOMERfacts.birth_date
Trade item description20multi_line_text_fieldStores a precise product description that describes specific attributes of the product for customs and import.PRODUCT
PRODUCT VARIANT
import_information.trade_item_description
Product transport declaration21list.single_line_text_fieldStores public transport declarations, such as batteries, hazardous materials, creams, liquids, or powders.PRODUCT
PRODUCT VARIANT
import_information.product_transport_declaration

Read: Shopify Plus – Setting up Quantity Rules, Volume Pricing, and Rounding Prices

Custom

These definitions are unique to your store. Use custom definitions for any metafields that don’t have standard definitions or if you want to migrate existing unstructured metafields to a definition.

Unstructured Metafields

These are metafields without definitions. You can edit metafields without definitions.

Create a definition for sets of unstructured metafields

Steps:

  • From your Shopify admin, go to Settings > Custom Data.
  • Select the part of your store to which you want to add a metafield definition. For example, Product metafields.
  • Click Add Definition next to the namespace and key that you want to add a definition for.
  • Enter the following information for your metafield definition:
    • In the Name field, enter a name for your definition.
    • Optional: In the Description field, enter a description for your metafield.
  • Click Select Type and select the Content Type that best matches your metafield values from the list.
  • Configure the content type and validation information by doing the following:
    • If the content type has additional configuration options, select the correct option for your metafield. For example, type of measurement.
    • In the Validation section, configure the Additional rules for your definition.
  • Click Save.
  • Review the validation results, and then click Save and Continue.

Edit Unstructured Metafields

Third-party metafields from an app can be migrated into your Shopify admin, but they’re hidden.

Steps:

  • From your Shopify admin, go to Settings > Custom Data.
  • Select the part of your store you want to add a metafield definition. For example, Product metafields.
  • Click View Unstructured Metafields or, if you have other options available, now click More actions > View unstructured metafields. If View unstructured metafields isn’t available, then your store doesn’t have unstructured metafields.
  • Click the metafield line for the definition you want to edit, and then add the value.
  • Click Save.

App-owned Metafields
These definitions are created using an app from the Shopify App Store.

Read Also: Shopify Implementation Partner

Metafield Definition

Metafield definitions have the following parts:

  • Name: It is used to identify the metafield in your Shopify admin, such as Color.
  • Namespace and key: The unique identifier for your metafield. You can use a namespace to group similar metafields, but each namespace and key must be unique. An example is custom.color.
  • Description (optional): This allows you to include descriptive information, such as what values to enter for the metafield.
  • Type: The type of data that the metafield stores, such as text, file, or URL.
  • Categories (on standard product metafield definitions only): The standard product categories with which the standard product metafield is associated.
  • Validations (optional): The rules for the values input, such as character limits, or minimum and maximum values.
  • Options: where the metafield is available to use.

Access

You can give the metafield access to Storefronts. It means the metafield can be connected to your theme using dynamic sources. Access options for custom data: 

  • Access options help you adjust what areas of your store can display your custom data on the Storefront.
  • Turning on Storefront access allows you to use the metafield or meta object for your Storefront in your Online Store 2.0 theme editor, through Liquid, with dynamic sources, or with Custom Storefronts and Hydrogen.
  • Turn on or turn off Storefront access. You can turn on or off Storefront access for your metafields and metaobjects.

Steps:

  • In your Shopify Admin, go to Settings > Custom Data.
  • Click the part of your store that has the metafield or meta object you want to change the access options.
  • Click the metafield or metaobject.
  • In the Access section, toggle Storefronts to turn off or on.
  • Click Save.

Features: 

  • Use as a filter in admin allows you to use the metafield to filter product searches in the Shopify admin.
  • Use in automated collections allows you to use the metafield to create an automated collection.

Locating your Read-only App Metafields

You can access a list of your app-owned metafields in a specific resource.

Steps:

  • In your Shopify admin, go to a resource that has metafields. For example, you can go to a product page.
  • In the Metafields section, click Show All.
  • Click More actions > View read-only app metafields.

Metaobjects

There are two key components to metaobjects:

  • The definition: the group of fields that defines the object’s structure. This is managed in Settings > Custom data in your Shopify admin.
  • Entries: the content or data for the metaobject. Entries are created and managed in Content > Metaobjects in your Shopify admin.

Types of metaobjects

  • Standard: These definitions are automatically configured for you and are designed to be universally compatible across Shopify. Because standard metaobject definitions follow standards used across all Shopify stores, they’re supported by apps, themes, and other parts of your store.
  • Custom: These definitions are unique to your store. Create a custom metaobject when no standard definition meets your needs.
  • App-created Metaobjects: These definitions are created by an app.

Navigating the Content Section in the Admin

Metaobjects and files are both accessible from the Content section in the admin. You can find this section from the admin navigation bar.

Managing Metaobjects

Contents > Metaobjects list all your shop’s metaobjects. Four default saved views are displayed as cards along the top which navigate to a filtered view of this list. The following default saved views are available:

  • Available on storefront: Metaobject entries that are available to your storefront
  • Web pages: Metaobject entries with the web pages capability activated
  • Active: Metaobject entries with status set to Active
  • Draft: Metaobject entries with status set to Draft

On larger screens, six saved view cards are displayed. This requires you to have created at least 2 custom-saved views. You can find instructions below for using saved views.

Recent entries are also displayed on this page and feature all metaobject entries in reverse chronological order.

Finally, you can search, filter, and sort your metaobject definition list as needed.

Using Saved Views

Metaobject entry lists can be configured with saved views to easily return to filtered lists of metaobject entries.

Steps:

  • Select the + icon in the top bar to open the Create a new view modal.
  • Enter a name for your saved view.
  • Select the search and filter icon in the top bar with your newly created saved view open.
  • Add the filters you want this saved view to use. These can either be a free text search, or structured filters (updated, created, added by, or fields on the metaobject definition).
  • Click Save.

Managing Files

Content > Files lists of all your shop’s files. You can search and filter your files based on file size, the file type (image, video, external video, 3D model, or other), and where files are used (products, other). 

Locating your App-controlled Metaobjects

When you create a metaobject definition, you specify the following information:

  • Name: It is used to identify the metafield in your Shopify admin, such as Authors.
  • Type: The data type the metafield stores, such as text, file, or URL.
  • Fields: It defines the type of content you want to display in the metaobject
    • Each field has a name (required), description, type, and validation rules, such as character limits, minimum and maximum values, or preset values.
    • The display name is assigned to a single field name used to identify an individual metaobject entry. You can change the field to which the display name is assigned at any time. The display name is automatically assigned to the first text field in a metaobject entry, or autogenerated if there are no text fields in the metaobject definition.
    • For example, add a field for text and indicate it as a display name, a field for an image, and a field for color.

Options:

Options are where the metaobject is available to use.

  • Access: By default, Storefronts access is activated for your metaobject. The metaobject can be connected to your theme using dynamic sources. You can deactivate Storefronts access. Learn more about access options.
  • Features: You can use the metaobject to create Web pages. Learn more about building web pages with metaobjects.

Locate your App-created Metaobjects

You can access your app-controlled metaobjects in your Shopify admin by filtering your metaobject definitions.

Steps:

  1. In your Shopify admin, go to Content > Metaobjects.
  2. Do any of the following:
    • Click the sort icon, and then sort by Added by. Your metaobjects will be sorted alphabetically by the person or app that added them.
    • Click Add filter > Added by, and then choose the app name to view the metaobjects added by it.

Features for Custom Data

Features for custom data expand what your metafields and metaobjects can do in your store.

Types of Features

Depending on the type of custom data, the following features are available:

List of Features Available for Metaobjects

FeatureAvailabilityDescription
Storefronts accessMetaobjectsAllows you to use the metaobject in your Online Store either through Liquid or the Storefront API.
Publish entries as web pagesMetaobjectsAllows you to use the metaobject to build a theme template for a web page. You need Storefront access selected for this feature.
Active-draft statusMetaobjectsEntries can transition between active and draft publishing states.
TranslationsMetaobjectsEntries can be translated into different languages.
Use as a filter in metaobject indexMetaobject fields of the following types:Single line text / Single line text (list)Product reference / Product reference (list)True or falseCollection reference / Collection reference (list)Page reference / Page reference (list)Metaobject reference / Metaobject reference (list)Allows you to use a field of your metaobject to filter in the metaobject index. You can activate this feature for a maximum of 50 metaobject field definitions.

List of features available for metafields

FeatureAvailabilityDescription
Storefronts accessAll metafield typesAllows you to use the metafield in your Online Store either through Liquid or the Storefront API.
Use as a filter in the product indexProduct metafields:Single line text / Single line text (list)Product reference / Product reference (list)True or falseCollection reference / Collection reference (list)Page reference / Page reference (list)Metaobject reference / Metaobject reference (list)Allows you to use the metafield to filter in the product index. You can activate this feature for a maximum of 50 metafield definitions.
Use in automated collectionsProduct metafields:Single line textSingle-line text (list)True or falseIntegerDecimalRatingAllows you to use the metafield to create automated collections. You can activate this feature for a maximum of 128 metafield definitions.

Activate or Deactivate Features

  1. In your Shopify Admin, go to Settings > Custom data.
  2. Click the part of your store that has the custom data you want to change the features.
  3. Click the custom data type.
  4. Select or deselect the feature option available in the Options section of the metafield or metaobject.
  5. Click Save.

About The Author

We take the guesswork out of ecommerce.
Schedule a consultation call today