How to Delete Multiple Documents in Sanity

1 replies
Last updated: Jun 9, 2020
How to delete multiple documents?
Jun 8, 2020, 8:07 PM
Answered in DM but leaving this here in case others are looking. You can delete multiple documents one by one by running the following command:
sanity documents delete <docId>

Alternatively, you can run a script to remove a batch of up to 1k documents at the same time, but be sure to make a dataset export/backup before 
🙂 https://github.com/sanity-io/sanity-recipes/blob/master/snippets/deleteDocsByFilter.js
Jun 9, 2020, 9:44 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.