Skip to main content

How to delete metafields in bulk with the bulk editor

Intro​

This option allows you to delete all instances of a specified metafield in a single action. Can be applied to all resources and/or a filtered selection.

This is one of three ways to bulk-delete metafields - see How to delete metafields in bulk to compare the bulk editor with the Excel-like editor and the export/import approach.

In case you are not familiar with the basics of our bulk editor, you should check out this step-by-step tutorial before you proceed.

Configuring a bulk action​

Select the "Delete metafield" option in the drop-down menu:

delete_metafield.png

Next, you can specify the details for a metafield to be updated. Press the Select metafield button (1) to reveal the available options (2). Select the one that fits your specific task the most:

select_the_one_specific_task.png

Specifying the metafield data​

You can specify the namespace, key, and type of a metafield to be deleted. Alternatively, you can remove the type-based condition and have all metafields with a matching namespace/key combination deleted regardless of their type.

Let's see a real-world example. Imagine a situation where the vast majority of your products have a list of color swatches:

color_swatches.png

However, some of them were created with the wrong type and ended up being plain texts:

the_wrong_type.png

If you were to delete only those "text" ones, you'd configure the bulk action like this:

delete_only_those_text_ones.png

However, if you were to delete all instances of the given namespace/key combination with no regard to the type, it would look like this:

delete_all_instances.png

Running multiple bulk edits​

You can configure up to 5 concurrent bulk edits. If you want to update more metafields, press the Add new action button and repeat the process:

add_new_action.png

Reverting a bulk delete​

Every bulk action automatically generates a Backup file - a CSV of the data as it was before the action ran. Once the task completes, open Bulk Actions → History, find the task, and download its Backup file. Re-import it with the CSV import feature to restore the deleted metafields. A task usually has a single backup file; only when some of its actions overwrite the results of earlier ones is the backup split into one file per action - then import those in reverse order, from the last action to the first.