How to Delete All Assets That Aren't Used After Development

2 replies
Last updated: Sep 27, 2021
During development I needed to add a lot of assets that are not necessary any longer. Is there a way to delete all assets that aren't currently used?
Sep 27, 2021, 10:17 AM
Hi
user T
, this snippet should let you do exactly that πŸ™‚ https://github.com/sanity-io/sanity-recipes/blob/master/snippets/deleteUnusedAssets.js
Sep 27, 2021, 10:33 AM
Works like a charm. Thanks!
Sep 27, 2021, 10:34 AM

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.