How to find and delete metafields left behind by uninstalled Shopify apps
Updated 2026-11-22
Review apps, size charts, bundles and SEO tools often store their data in metafields. When you uninstall the app, that data can stay behind. If the metafields have no definition, they don't show up in the admin's metafield settings, so most merchants never know they're there.
They're usually harmless, but they clutter exports and migrations, and leftover theme code can still read them.
Step 1: Find metafields without a definition
Run a read-only query in the Shopify GraphiQL app (or any Admin API client). The key field is definition. When it comes back null, that metafield has no definition.
{
products(first: 100) {
nodes {
id
title
metafields(first: 100) {
nodes { namespace key type value definition { id } }
}
}
}
}
Repeat for variants, collections, customers and the shop if you need to, and paginate for larger catalogs.
Step 2: Group them by namespace
The namespace usually tells you which app created the data (judgeme, spr, an old size-chart app, and so on). Group the ghost metafields by namespace, check which apps you still use, and decide which namespaces to remove.
Don't touch:
$app/app--…namespaces. These are app-reserved: only the app that owns them can delete them. Shopify removes an app's own definitions when you uninstall it and keeps the values only temporarily.shopifynamespaces (Shopify's standard data).
Step 3: Back up, then delete
Save the values you're about to delete (the JSON from step 1 is enough). Then use the metafieldsDelete mutation, which takes the owner ID, namespace and key. You do not need to create a definition first. Current API versions accept up to 250 metafields per call; older versions accepted 25.
mutation {
metafieldsDelete(metafields: [
{ ownerId: "gid://shopify/Product/123", namespace: "old_app", key: "rating" }
]) {
deletedMetafields { ownerId namespace key }
userErrors { field message }
}
}
Before deleting, search your theme code for the namespace (old_app.) to make sure nothing still reads it.
A free tool for steps 2 and 3
I built a free browser tool: paste the JSON from the query above and it groups ghost metafields by namespace, protects app-reserved ones, and gives you a backup file and ready-to-run cleanup mutations. Nothing is uploaded: scan your metafields.