Help on how to delete metafields without a definition

Topic summary

Main issue: After importing product specs via a “metafields 2” app for a move to Online Store 2.0, many product metafields are left “without a definition” (i.e., custom fields that aren’t tied to an admin-defined metafield definition). The poster wants a safe, non-developer way to bulk delete these, fearing performance impact.

Proposed approach:

  • Use Shopify Flow to trigger on a product event (e.g., status change), iterate metafields, and delete those lacking a definition.

Caveats and risks:

  • Not safe in practice: many apps store critical data in undefined metafields (e.g., reviews, Google Shopping categories). Deleting them may break integrations.
  • Performance impact is likely minimal unless there are hundreds of metafields per product or theme/app code inefficiently loops over all metafields on render.

Status/outcome:

  • No confirmed easy or safe bulk-deletion solution provided.
  • Recommendation trends toward caution: avoid automated deletion unless you can precisely identify non-essential metafields.

Open questions:

  • A safe, user-friendly method to selectively remove only true “junk” metafields remains unresolved.
Summarized with AI on December 31. AI used: gpt-5.

I’m working towards a switch to version 2.0 and part of this involves making use of metafields for products specifications etc.

I created the metafields in my shopify admin and installed the metafields 2 app to import these. After some trial and error, I’ve been able to import what I need, but I’ve been left with quite a lot of junk data in “metafields without a definition”.

I’ve read that junk can affect site performance, so I’d like to get rid of these. The metafields 2 app doesnt allow me to do this. Shopify support suggested that this could be done using shopify API, but I’m not a developer and would have concerns that I might create more problems if I try this.

I wanted to reach out to see if anyone had an easy solution for this which would allow me to clear this unwanted data.

It would be possible to create a flow in Shopify Flow App to run, say, each time the product status is changed, loop over all metafields and delete ones which do not have a definition.

This, however, is not really safe – there is a lot if information stored in metafields by Apps, like product review data or Google Shopping product categories, etc.

While these has no definition, deleting them would not be wise.

Also, i doubt having a bunch of extra metafields would really slow down your store (though I have no testing data).
Unless you have hundreds of metafields or some notoriously bad code to loop over all of them each time product card is rendered in collection grid I would not pay much attention to it.

1 Like