Metafields for Import and Export
Metafield values are primarily managed within the entity they exist in, for example, to export or import B2B Company Metafields, you would normally need to do this through the Companies export/import sheet.
Matrixify app allows you to bulk manage, export, import, and update almost all entity Metafield values that Shopify supports natively:
- Product Metafields
- Product Variant Metafields
- Smart Collection Metafields
- Custom Collection Metafields
- Customer Metafields
- Order Metafields
- Draft Order Metafields
- Company Metafields
- Company Location Metafields
- Page Metafields
- Blog Post Metafields
- Shop Metafields (These are Metafields that are attached to your Shop itself. They cannot be seen in admin natively and do not have definitions in Shopify).
Additionally, Metafields can be imported as a separate Metafields entity/sheet to bulk manage Metafields for multiple entities with a single import sheet.
Exporting Metafields
By default, the Matrixify app will export Metafield columns for Metafield definitions set up in the store, as well as export Metafields without definitions that are set to at least one of the exported items.
Select to export specific Metafield columns
You can adjust what Metafield columns are selected by adjusting the Metafield column selector when creating an export in the app.
Open the selected Metafields column group and next to the Metafield column click on the pencil icon button.
A popup will open allowing you to apply rules for the Metafield selector by the Metafields Namespace, Key and Type.
In both Namespace and Key selectors you can apply the conditions:
equals to any of
– comma-separated list of Metafield Namespaces or Keys to include as columns in the exported file.not equal to any of
– comma-separated list of Metafield Namespaces or Keys to exclude from the exported file.
In the Type selector, you can select checkboxes of all available Metafield Types to include only Metafields with specific Types.
To only export Metafield columns that have value in at least one of the exported items you can also select the checkbox “Exclude Metafields without values”.
Column Names
Metafield column headers are constructed in the following template: Metafield: namespace.key [type]
.
The column will start with Metafield:
except for Variant Metafields where it will start with Variant Metafield:
.
Namespace and key
After this, the column header will have the namespace.key
combination which is used to identify the Metafield that is being imported.
If Metafield definitions have been set up in the store, then you can see the Metafields namespace and key in that definition:
When importing, if there is no namespace defined in the column header, then the global
namespace is used.
You can have almost unlimited Metafields per item – just add them as additional columns.
If there is a dot already in Metafields namespace or key then in the exported and import files it is escaped with a backslash: \.
.
Metafield Type
The last part of the Metafield column header is the Metafield type. It is always set in square brackets []
.
You can also import Metafield column without the type specified. If Metafield Type is not specified, the app will:
- Use type from the existing metafield on the resource.
- If the owner type has a definition with the same Namespace and Key, then the type will be taken from that definition.
- If there is no existing metafield or definition on the resource, the app will try to infer type from the Value.
When exporting Metafields – in Excel those types will be reflected as cell value types. If the value is a number_integer
type, then in the Excel cell that will also be visible as an integer. And if that’s a single_line_text_field
, then, of course, it will also be visible as a text type, even if it will contain a numeric value.
Example columns headers with specified types:
- for number_integer:
Metafield: specs.mu_number [number_integer]
- for boolean:
Metafield: specs.is_it_cool [boolean]
- for product_reference:
Metafield: specs.other_products [product_reference]
- etc…
Each Metafield for each item can have one of the types:
All Metafield Types
We have compiled all possible Metafield types to see what is the correct type value to use in the import file and an example of the value that would need to be set to import.
You can also see Shopify Metafields manual page for metafield type descriptions.
Date and Time
Type | Description / Example Value |
---|---|
date | A date in ISO 8601 format. If the Metafield is set as “List of values” in Shopify then list. is added at the front of the Metafield type.
Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value2021-10-25 Example – List of values2021-10-25, 2025-09-22 |
date_time | A date and time in ISO 8601 format. If the Metafield is set as “List of values” in Shopify then list. is added at the front of the Metafield type.
Allowed ValuesDate and time in ISO 8601 format (Can be set with the time zone. We will convert the time to the shop time zone to determine the date & time). If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value2021-10-25T14:30:00 Example – List of values2021-10-25T14:30:00, 2021-10-25 19:30:00 |
Measurement
Type | Description / Example Value |
---|---|
weight | A value and a unit of weight.
Valid weight unit values:
If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Examples – One value2.5 kg { "unit": "kg", "value": 2.5 } Examples – List of values1100 g, 600.5 kg [{"value":1100.0,"unit":"g"},{"value":600.5,"unit":"kg"}] |
volume | A value and a unit of volume.
Valid volume unit values will be converted to these Shopify units (same as Shopify native CSV Import):
If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Examples – One value20 ml { "unit": "ml", "value": 20.0 } Examples – List of values1 ml, 0.001 l [{"value":1.0,"unit":"ml"},{"value":0.001,"unit":"l"}] |
dimension | A value and a unit of length.
Valid dimension units:
If the Metafield is set as “List of values” in Shopify then If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Examples – One value25.3 cm { "unit": "cm", "value": 25.3 } Examples – List of values1000 in, 54.5 mm [{"value":1000.0,"unit":"in"},{"value":54.5,"unit":"mm"}] |
Number
Type | Description / Example Value |
---|---|
number_integer | A whole number in the range of from -9007199254740991 till 9007199254740991 .
If the Metafield is set as “List of values” in Shopify then Allowed ValuesInteger number (Will round decimal numbers). If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value10 Example – List of values8,2,3 |
number_decimal | A number with decimal places in the range from -9999999999999.999999999 till 9999999999999.999999999 .
If the Metafield is set as “List of values” in Shopify then Allowed ValuesNumber If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value10.545 Example – List of values1.123, 2.545, 3.987 |
Text
Type | Description / Example Value |
---|---|
single_line_text_field | A single-line text field. Will not allow importing text with line breaks/newlines in it.If the Metafield is set as “List of values” in Shopify then list. is added at the front of the Metafield type.
Allowed ValuesText in a single row. If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valueThis item contains dairy products. Examples – List of valuesthis,is,list,with 4 values ["this","is","list", "with 4 list values"] |
multi_line_text_field | A multi-line text field.
Multi Line Text Metafields cannot be set to as a List of values. Allowed ValuesText ExampleIngredients: Flour Water Milk Eggs |
rich_text_field | Rich text field. Exported as Shopify-specific JSON code.
Rich Text Metafields cannot be set to as a List of values. Allowed Values
Examples{"type":"root","children":[{"type":"heading","children":[{"type":"text","value":"My First Heading"}],"level":1},{"type":"paragraph","children":[{"type":"text","value":"My first paragraph."}]}]} <h1>My First Heading</h1> <p>My first paragraph.</p> My First Heading === My first paragraph. |
Reference
Type | Description / Example Value |
---|---|
product_reference | A reference to a product from this online store.
When exporting, the value will show as a product Handle. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuesummer-jacket Example – List of valuessummer-jacket, winter-coat, colorful-shirt |
collection_reference | A reference to a collection from this online store.
When exporting, the value will show as a collection Handle. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuesummer-sale-collection Example – List of valuessummer-sale-collection, branded-clothes |
variant_reference | A reference to a product variant from this online store.
When exporting, the value will show as If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuesummer-shirt.Red Small Example – List of valuessummer-shirt.Red Small, summer-hoodie.XL |
file_reference | A reference to a file from this online store.
When exporting, the value will show as a file name. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuesummer_image.jpg Example – List of valuessummer_image.jpg, 50002-102-02.jpg |
metaobject_reference | A reference to a metaobject entry from this online store.
When exporting, the value will show as a If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuemanufacturer.Robert-Jones Example – List of valuesmanufacturer.Robert-Jones, manufacturer.July-Smith |
page_reference | A reference to a page from this online store.
When exporting, the value will show as a page Handle. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). To reference page outside of this store, use the URL field. If the Metafield is set as “List of values” in Shopify then Allowed ValuesIf Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valueabout-us Example – List of valuesabout-us, contact-us |
order_reference | A reference to order from this online store.
When exporting, the value will show as an order name. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). If the Metafield is set as “List of values” in Shopify then Allowed ValuesIf Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value#1234 Example – List of values#1234, #2756 |
customer_reference list.customer_reference |
A reference to a customer from this online store.
When exporting, the value will show as a customer email. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value[email protected] Example – List of values[email protected], [email protected] |
company_reference | A reference to the Company within your Shopify store.
When exporting, the value will show as a Company Name. (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID). If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valueSunday Shop Example – List of valuesSunday Shop, Main Street Lucy Store |
article_reference | A reference to a Blog Post.
When exporting, the value will show as combination of If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuesummer-blog.best_shirts_for_summer Example – List of valuessummer-blog.best_shirts_for_summer, other-blog.best-clothing-stores |
Other
Type | Description / Example Value |
---|---|
color | The hexadecimal code for a color.
Allowed ValuesColor hex code If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One value#fff123 Examples – List of values["#44b144","#ff0000"] #44b144, #ff0000 |
money | Amount of money in specific currency.
Money Metafields cannot be set to as a List of values. Allowed Values
Examples{"amount":"15.0","currency_code":"EUR"} 15 EUR |
rating | A rating measured on a set scale.
If the Metafield is set as “List of values” in Shopify then Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Examples – One value3.5 {"value": "3.5", "scale_min": "1.0", "scale_max": "5.0"} Examples – List of values3.5, 9.0 [{ "value": "3.5", "scale_min": "1.0", "scale_max": "5.0" },{ "value": "9.0", "scale_min": "1.0", "scale_max": "10.0" }] |
boolean | A true or false value.
True or false boolean Metafields cannot be set to as a List of values. Allowed Values
ExampleTRUE |
url | A URL to any website page.
If the Metafield is set as “List of values” in Shopify then Allowed ValuesURL with one of the allowed schemes: Example – One valuehttps://matrixify.app/ Example – List of values["https://matrixify.app/","https://shopify.com/"] |
link | A link with text. Links value must be prefixed with: https , http , mailto: , sms: , tel: .
Allowed ValuesJSON Can be imported as only a link, but then there will be no alt text set. Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Examples – One valuehttps://matrixify.app/tutorials/ {"text":"Matrixify Tutorials page","url":"https://matrixify.app/tutorials/"} Examples – List of valueshttps://matrixify.app, https://shopify.com [{"text":"Matrixify website","url":"https://matrixify.app"},{"text":"Shopify website","url":"https://shopify.com"}] |
Advanced
Type | Description / Example Value |
---|---|
json | A JSON-formatted string.
JSON Metafields cannot be set to as a List of values. Allowed ValuesValid JSON code Example[{ "k": "v1" }, { "k": "v2" }] |
mixed_reference | A reference to a metaobject entry from this online store. Can be used to specify entries from multiple different metaobject definitions.When exporting, the value will show as a <definition_handle>.<entry_handle> . (Can ask Matrixify Support to set up for specific store to export reference Metafields as Shopify internal GID).If the Metafield is set as “List of values” in Shopify then list. is added at the front of the Metafield type.
Allowed Values
If Metafield is a list type, then value can be JSON Array or a list separated by a comma, a semicolon or a new line in a single cell. Example – One valuemanufacturer.Robert-Jones Example – List of valuesmanufacturer.Robert-Jones, manufacturer.July-Smith |
Deprecated/old metafield types
If importing Metafield with the below listed old types, app would primarily check if there is Metafield definition in the store with he same Namespace and Key and if found then use the type from the definition ignoring the old type specified in the file.
Type | Description / Example Value |
---|---|
integer | A number.
Allowed ValuesWhole Example10 |
string | A text.
Allowed ValuesText ExampleThis is red shirt. |
json_string | JSON format code.
Allowed ValuesJSON Code Example[{ "k": "v1" }, { "k": "v2" }] |
Cell Values
Each row cell is a Metafield value of that respective Metafield column.
In Shopify – Metafields are actually not columns, they are entries for each separate item. There can be some items with Metafields, and some without.
If the exported Metafield value is empty, then it means that this Metafield doesn’t exist. Shopify cannot have Metafields with empty values.
When the Metafield is imported:
- If there is some value, then it will either create or update the existing Metafield in Shopify.
- If the value is empty, then this Metafield for that item will be deleted (not set to empty value, but deleted).
Deleting Metafields
To delete Metafields, just set all values to empty, and import it.
Import Metafields by row
In the Export and Import, Matrixify app primarily uses Metfields by columns as explained above.
You can also import Metafields by row.
Metafields by row can also be mixed with Metafield columns from Matrixify template.
Column Name | Description |
---|---|
Metafield Namespace | A container for a set of metafields. You should define a custom namespace for your metafields to distinguish them from namespaces used by apps and Shopify (including the default global ). For Metafields with a definition, can be found in the Shopify admin as the first part of the namespace.key combination. |
Metafield Key | The name of the metafield. For Metafields with a definition, can be found in the Shopify admin as the second part of the namespace.key combination. |
Metafield Value Type | The metafield’s type. See Metafield Types for valid type values. |
Metafield Value | The value set in the Metafield. Different Metafield Types may require differently structured values. |
For Products – this way you can import both Product and Variant Metafields. If the row is for Variant then app will save that Metafield as Variant Metafield, if there is no variant in the row then the app will save it as product Metafield. If you need to have multiple Metafields for the same variant then copy whole variant row for each additional Metafield row (or use Metafield columns from Matrixify template).
Above example, each variant would have 1 Metafield and the product itself would have 2 other Metafields.
Import Metafields as entity sheet
You can also import a separate sheet/entity “Metafields” where you can list your Metafield values by row and combine Metafields from all data entities that support Metafields in a single import sheet, for example, import Product and Collection Metafields within the same import sheet.
Column Name | Description |
---|---|
Owner | Data entity type to which the Metafield belongs.
Required column. Allowed Valuesproduct variant customer company company_location order draft_order Exampleproduct |
Owner ID | Shopify internal ID for the owner of the Metafield. For example, for Product metafield, this would be the Product ID , for Variant metafield, this would be the Variant ID .
Not required if the Allowed ValuesShopify internal ID Example11920047631 |
Owner Handle | Secondary identification for the owner of the Metafield. Useful in case you do not have the Owner ID .
Not required if Different value structure based on the Allowed Values
Examples
winter-red-shirt
winter-red-shirt.Small
[email protected]
Lucilles Store
Lucilles Store.Center Street
#81346
#D5571 |
Namespace | A container for a set of metafields. You should define a custom namespace for your metafields to distinguish them from namespaces used by apps and Shopify (including the default global ). For Metafields with a definition, can be found in the Shopify admin as the first part of the namespace.key combination.
If not specified, Matrixify will assume the Namespace as |
Key | The name of the metafield. For Metafields with a definition, can be found in the Shopify admin as the second part of the namespace.key combination.
Required column. |
Type | The metafield’s type. See Metafield Types for valid type values.
Not mandatory. The app can detect type from existing metafield, definition, or try to infer from the Value. |
Value | The value set in the Metafield. Different Metafield Types may require differently structured values.
If the Value is empty, then the app will try to find and delete the existing metafield from the owner. |
Metafield values with more than 32767 characters
The problem
Microsoft Excel has some limitations that can sometimes cause trouble when working with large amounts of data. One of those limitations is 32767 character limit for a single cell.
Multiple other apps use Metafields to store various information and it can get quite large over time. If some Metafield value is over this Excel limit of 32767 characters, then it will still be all exported, but when opening the file in Excel it will first display error:
"We found a problem with some content in 'Export_2019-06-18_1659.xlsx'. Do you want us to try to recover as much as we can?".
When Excel has recovered the data it will cut all cell values over the limit to 32767 characters. Saving this file and importing back into the Shopify will result in the Metafield being saved with these 32767 characters, thus cutting the rest off information in that cell.
Note that it will cut it off only if you open the exported .xlsx or .csv file in Excel, and save it. If you will not save the file, and import it by just exporting, then nothing will be cut off – you will be all good.
Solution
We have made the Matrixify app to locate this possible issue and not update any Metafields whose values are exactly 32767 characters (the cut-off cell size).
If the cell value is over 32767 Characters that means that Excel has not cut it and it’s good to import.
If the cell value is under 32767 Characters that again means that Excel has not forcefully cut anything and Metafield will bet set/updated as usually.
Once the Matrixify will detect Metafield with this exact length it will not fail the item, but in the Import Results file a warning will be returned:
"Warning: [Metafield: namespace.key [type]] is not saved. It may be cut off by the Excel because of the 32767 character limit."
Metafields from other Shopify Apps
Metafields with a namespace structure app--<app_id>--<custom_text>
, for example app--123987456--sale_type
, are reserved only for the app that created the Metafield. You would not see such a Metafield column in the exported file and would not be able to import it.
Those Metafields can only be managed by the app that created them, which has the Shopify Internal ID as per the Metafield namespace, or via the Shopify Admin manually.
Read more in the Shopify manual on App-Owned Metafields.
Good To Know
- To update existing Metafields or add new, minimum required columns are:
- ID
- Handle (if you want it to identify item by Handle)
- Metafield: ****
- When importing Metafields that you will need to use in definitions, it is best to set up the Metafield definitions first in your Shopify Admin -> Settings -> Custom Data. If definitions have not been set, then they will be imported as “Metafields without definitions”. Shopify limits what types of Metafield definitions can be created from “Metafields without definitions”, such as, you will not be able to then set up those definitions as Rich text or reference types.
- The easiest way to learn Metafields is to export them and watch how they are in Excel (or in CSV). Then import them back, and see what changed. You can do those experiments with just one row.
- Shopify allows probably unlimited Metafield values per item (at least we haven’t seen any real limit). If you need to export more than 10’000 columns of Metafields, then please use CSV file format because Excel will struggle with more columns.
- See more about Metafields – what they are, and why there exist, in this tutorial: How to manage Shopify Metafields?