Deleting metafields

If you no longer want to have a metafield for part of your store, then you can delete the metafield definition. When you delete a metafield definition, you can choose between the following options:

  • Delete only the metafield definition.
  • Delete both the metafield definition and all associated metafield values.

If you want to save the values associated with a metafield, then delete only the metafield definition. After you delete the definition, you can access the values by migrating them to a new custom metafield definition with the same namespace and key.

Considerations for deleting metafields

Before you delete a metafield, make sure that it isn't connected to a block or section in your live theme. Deleting metafields that are connected to your theme can cause display errors for customers visiting your online store. You need to resolve these errors before you can make any other changes to the theme templates associated with that metafield.

You can't delete a category metafield that is connected to your variant options. Before you can delete the category metafield definition, you need to disconnect the category metafield from your variant options.

Delete a metafield definition

  1. From your Shopify admin, go to Settings > Custom data.
  2. Select the part of your store that contains the metafield definition that you want to delete.
  3. Click the metafield definition that you want to delete.
  4. Click Delete, and then select one of the following options:
    • To preserve the associated values on parts of your store, click Delete field only.
    • To completely delete the metafield and all its associated values, click Delete field and its saved values.
Can't find answers you're looking for? We're here to help you.