Joint session with Vercel: How to build intelligent storefronts (May 15th)

Is there an easy way of clearing unwanted published items?

5 repliesLast updated: Nov 29, 2025

HI I have published once but my data shows an array?
"result":[2 items
0:{6 items
"_createdAt":"2020-10-30T07:44:59Z"
"_id":"932ebb41-cf8d-463d-9ad9-6e4c88588b54"
"_rev":"XNtMa4Y66vmVFnyOJAoV3C"
"_type":"siteSettings"
"_updatedAt":"2020-10-30T08:08:55Z"
"owner":{4 items
"facebook":"@facebook"
"instagram":"@instagram"
"name":"Amy Robers"
"twitter":"@twitter"
}
}
1:{8 items
"_createdAt":"2020-10-30T11:51:03Z"
"_id":"siteSettings"
"_rev":"XNtMa4Y66vmVFnyOJEK8AQ"
"_type":"siteSettings"
"_updatedAt":"2020-10-30T15:53:17Z"
"name":"Amy"
"person":{3 items
"facebook":"<https://yourfacebookurl/>"
"instagram":"<https://yourinstagramurl/>"
"twitter":"<https://yourtwitterurl/>"
}
"website":"<http://yogawithamy.com|yogawithamy.com>"
}
]
How can I clear that first array? Thanks
AI Update

Looking at your data, you have two documents of type siteSettings with different _id values:

This is a common issue when setting up singleton documents - you've accidentally created multiple instances of what should be a single-instance document type.

To fix this, you need to delete the duplicate document. Here's how:

Based on your data, you probably want to keep the second one (_id: "siteSettings") since it has your actual content (name: "Amy", website, etc.) and delete the first one.

To prevent this from happening again, configure your siteSettings as a proper singleton in your sanity.config.ts:

export default defineConfig({
  // ... other config
  schema: {
    types: schemaTypes,
    templates: (templates) =>
      templates.filter(({ schemaType }) => schemaType !== 'siteSettings')
  },
  document: {
    actions: (input, context) =>
      context.schemaType === 'siteSettings'
        ? input.filter(({ action }) => !['duplicate', 'delete', 'unpublish'].includes(action))
        : input
  }
})

This prevents creating additional instances through the "New document" menu and removes dangerous actions like duplicate/delete from the singleton document.

Show original thread
5 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions