Menu

1 / 5

Sanity dataset full of unused assets and old drafts: a safe cleanup

DEV Community: typescript·Nayan Kyada·8 days ago
#Ptb7F5vc
#devtotypescript#devto#dev#sanity#dataset
Reading 0:00
15s threshold

If your Sanity dataset has years of orphaned images, abandoned drafts and test documents nobody remembers creating, the Studio media browser crawls, exports take forever, and nobody trusts what is safe to touch. This is one of the most common things I find on inherited Sanity projects, and a Sanity dataset cleanup is usually a one-day job when done in the right order.

Symptoms of a cluttered Sanity dataset

None of these will take your site down. They just make every future change slower and riskier:

The Studio media library takes a long time to load, and editors cannot find the image they uploaded yesterday among thousands of near-duplicates.

Document lists are full of items titled "test", "copy of homepage" or "untitled".

Dataset exports and migration scripts take far longer than the visible content would suggest.

Nobody knows whether a document type is still used.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.