Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
I thought I'd post this here in case it's useful to others:
https://github.com/snaptortoise/shopify-metafields-bulk-delete
I was working with a client and ran into a situation where we needed to delete all of the current metafields associated with their products. The app they were using didn't make this easy, so I wrote a quick-and-imperfect script to tackle the issue. It worked quite well for our needs, so I'm sharing it here.
The imperfections are noted in the project's README file, but the most important one to point out is that it only works on stores with <= 250 products at the moment. You can amend the code to accommodate a larger store if you need, and I might amend the code at some point in the future if it turns out to be popular.
That's all. Hope it's helpful to someone!
Managed to get that workflow into the library in about 5 minutes. Sweet. It's just a stub in the public library for now but it can be imported into the app to use (or found in the in-app library). https://www.apps.bonify.io/mr-arigato-task-automator-for-shopify/workflows/bulk-delete-metafields