Metafields for Import and Export
Shopify Metafields are available as additional columns in the following Excel sheets:
Each new column represents specific Metafield – its Column name starts with “Metafield: “, and whatever follows after that, is the metafield name saved in Shopify.
To specify Metafield namespace, include it in the name, and split with dot (.). For example: “Metafield: namespace.fieldname“.
If there is no namespace defined, then the global namespace is used.
You can have unlimited Metafields – just add them as additional columns.
Each Metafield for each item can have one of types: “string” (text) or “integer” (whole number).
When exporting Metafields – those types will be reflected as Excel cell value types. If the value is integer type, then in the Excel cell that will also be visible as an integer. And if that’s a text, then, off course, it will also be visible as a text type, even if it will contain a numeric value.
The same applies for import. If you need to import number as “integer” type, then set the Excel cell type to number. And the app will automatically detect that.
Note that each row for the same Metafield column can have different type.
If you really want to force the field type, regardless of the Excel column type, you can specify the type in the column name by putting “[integer]” or “[string]” at the end.
So the column name for integer would be like that: “Metafield: somenamespace.somename [integer]”. Or for string: “Metafield: somenamespace.somename [string]”
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 exported Metafield value is empty, then it means that this Metafield is either empty for that row, or it doesn’t exist.
When the Metafield is imported, if there is some value, then it will either create or update 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).
To delete Metafields, just set all values to empty, and import it.
|Column Name||Allowed Values|
|Metafield: title_tag||Text||SEO Title
If the value will match exactly the same Product (or Collection) Title, then Shopify stores it as empty value. Also, if the value is empty, then Shopify will serve SEO Title the same as Product (or Collection) Title. Therefore – SEO Title is never empty.
When exporting, you will have some value only if it differs from the Product (or Collection) Title.
Mom Strength Red T-shirt Slim Fit
|Metafield: description_tag||Text||SEO Description
If the value will match exactly the same Product Description, then Shopify stores it as empty value. Also, if the value is empty, then Shopify will serve SEO Description the same as Product Description. Therefore – SEO Description is never empty, if Product has some description at all.
When exporting, you will have some value only if it differs from the Product (or Collection) Description.
Those t-shirts are the best ones for smart moms.
|Metafield: some number||Text or Number||If you set the value in Excel as a number, it will be automatically saved as “integer” type.
|Metafield: namespace.name||Text or Number||If column name starts with “Metafield: “, then what comes next is treated as Metafield name. To set the namespace, prefix it before the name, and “.” (dot). If namespace is not set, then it will be set to “global”.
If column name has “[string]” or “[integer]” at the end, then it will force the type accordingly from that.
If Metafield value is empty, then it will not be updated at all – this item Metafield will be ignored.
Anything can be written here.
|Metafield: birthday||Text or Number||If you want to save Customer birthdate, and use it in the Store.
Good To Know
- To update existing Metafields or add new, minimum required columns are:
- Handle (if you want it to identify item by Handle)
- Metafield: ****
- The easiest way to learn Metafields is to export them and watch how they are in Excel. Then import them back, and see what changed. You can do those experiments with just one row.
- There is no limit to how many Metafield columns can be added. We tested with more than 100 Metafield columns, and it was just fine. Go crazy if you need to! 😉