Install
Install

Bulk Create and Edit Shopify Metafield Definitions

Bulk create Shopify Metafield Definitions from an Excel or CSV file with Matrixify

In Shopify Admin you add Metafield Definitions one by one with the Add definition button. With Matrixify you can list them in one Excel or CSV file and Import them in one job. Here we will create definitions with choices and pinning, and then edit them in bulk.

Steps in short

  1. Create a spreadsheet with one row per Metafield Definition and the Owner, Name, Type, Namespace and Key columns.
  2. Add validation rules in the Validation columns and a number in Pinned Position for the definitions to pin.
  3. Import the file in the Matrixify app to create the definitions.
  4. Check the new definitions in Shopify Admin on the Metafields and metaobjects settings page.
  5. To edit existing definitions, Export them, update the file and Import it back.

1. List Metafield Definitions in a spreadsheet

A Metafield Definition determines where a Metafield is used, its namespace and key, data type, and validation rules. Each Metafield Definition is listed as a separate row in the file.

Create an Excel file with a sheet named Metafield Definitions, or a CSV file with Metafield Definitions in the file name, for example metafield-definitions.csv. Add these columns:

  • Owner – for example Products, Variants or Customers.
  • Name – the name shown in Shopify Admin, for example Material.
  • Type – for example single_line_text_field or number_integer. See all Metafield types.
  • Namespace and Key – together, these uniquely identify a Metafield, for example custom.material. The namespace groups related Metafields, while the key identifies a specific Metafield. Alternatively, you can use a single Handle column containing both values separated by a dot, such as custom.material.

You can also add other columns, for example to set API access or other Shopify options for the definitions. See all Metafield Definitions columns.

Matrixify does not automatically generate Namespace and Key from Name. Make sure each new row contains both columns or a Handle, otherwise the Import will fail for that row.

The Command column is optional. By default, Matrixify uses MERGE to create new Metafield Definitions or update existing ones.

Excel file to bulk create Shopify Metafield Definitions with Owner, Name, Type, Namespace and Key columns

Add Validations to Metafield Definitions

In Shopify Admin, each Metafield Definition has a Validation section that limits what can be entered in the Metafield. In the file, each limit has its own column, such as Validation: Choices or Validation: Min, and the Metafield Definitions documentation lists all of them. Add only the columns for the limits you want to set.

  • To limit the Metafield value to a fixed list, for example a Fabric field with Cotton, Linen or Wool, put the values in Validation: Choices, separated by a comma: Cotton, Linen, Wool. Shopify Admin then shows the definition as a Choice list. You can add choices only to a single_line_text_field or list.single_line_text_field definition, and they are optional for these types too. A validation list can have up to 128 values.
  • To allow only values between a lowest and a highest value, put them in Validation: Min and Validation: Max. For example, a number_integer definition with 1 and 5 accepts only whole numbers from 1 to 5. This is the Value range in Shopify Admin. Depending on the type, Min and Max can also be a text length, a date, or a weight, volume or dimension with its unit, for example 1 kg.

You can find the supported validation limits for each Type in Shopify’s list of validation options.

Pin Metafield Definitions with Pinned Position

Pinned Metafields show automatically on the matching pages in Shopify Admin, for example on the Product page – see pinning Metafield Definitions in the Shopify Help Center.

A number in Pinned Position pins the definition, an empty cell leaves it unpinned. The number does not set the order: in our test Fabric got 1 and Sizes 2, but Shopify Admin lists Sizes first. Change the order of pinned definitions in Shopify Admin.

2. Import to create Metafield Definitions

In the Matrixify app Home upload the file in the Import section with the Add file button. The app reads the sheet as Metafield Definitions and shows its row count. Press Import to start.

Matrixify Import of a file to bulk create Shopify Metafield Definitions

When the Import has finished, press Download Import Results. The Import Comment column shows NEW for each created definition, or the reason a row failed.

3. Check new definitions in Shopify Admin

This is it. In Shopify Admin go to Settings -> Metafields and metaobjects and click Products, or the other Owner you imported. The pinned definitions are at the top of the list.

Product Metafield Definitions in Shopify Admin created in bulk with Matrixify

4. Edit Metafield Definitions in bulk

To change existing definitions, Export them, update the file and Import it back. You can also use the file from step 1 and Import it again. In the Matrixify app Home create a new Export by using the New Export button.

Press Select Sheets and select Metafield Definitions.

Click on the Metafield Definitions sheet card to expand it and select these columns:

  • from Basic Columns: ID, Owner, Handle, Name, Pinned Position
  • from Validations: Validation: Choices

To Export only specific Metafield Definitions, press Set Filters under the sheet and add the filters you need, for example:

  • Owner with Products
  • Namespace with equals to any of and custom

Press Export and wait for the job to finish. Then press Download Exported File.

Now you can update the definitions in the file: rename them or add a new value to Validation: Choices, for example Silk. When the file is ready, Import it the same way as in step 2.

The app finds each definition by ID, or by Owner and Handle when there is no ID – the Import Comment then says UPDATE: Found by Handle. The Type and Handle of an existing definition cannot be changed – a different Type fails the row. A different number for an already pinned definition does not move it and only gives a warning.

Edit Shopify Metafield Definitions in bulk in an Excel file from Matrixify

Good to know

  • Each Export or Import job can have up to 10 Metafield Definitions on the Demo plan, 50 on Basic, 500 on Big and any number on Enterprise – see Pricing.
  • A row with the namespace and key of a Shopify standard definition, for example descriptors.subtitle, enables that standard definition instead of creating a custom one.
  • The same file can have a Products sheet with the Metafield values. The app Imports the definition sheets first, so the values find their new definitions.

What to do next?