✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

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– build remarkable experiences at scale

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

Was this answer helpful?