Build with Sanity MCP in Replit. Prizes up for grabs! Submit by June 14

Draft document auto-restores after deletion in Sanity Studio

5 repliesLast updated: Dec 1, 2025

Hello
TLDR; When deleting a non-published draft in Studio, it sometimes gets restored as an untitled document.

We have a pretty standard setup where we display a list of article documents in the Studio.

We have noticed that if you create a new article, then delete the draft without publishing it, it will then be restored without any content. The restored version does have the same id as the original draft document. Now, if you then fill in all fields, then publish the “auto restored” document, then publish and delete it, it will once again be “restored” as an empty draft.

Using
sanity documents delete ...
from the command line does not cause this restoring behavior.
This happens consistently with one of our document types, whilst another almost identical document does not have this issue.

Has anybody encountered this, tips?
AI Update

This is a tricky issue, and the fact that it happens consistently with one document type but not another is the key diagnostic clue. Since CLI deletion works fine, this points to something in your Studio configuration rather than a Content Lake issue.

Here are the most likely causes and how to debug them:

Compare the Two Document Types Side-by-Side

Since you have one document type that works correctly and one that doesn't, do a detailed diff of their schema definitions. Look specifically at:

Check Your Structure/Desk Configuration

If you have a custom structure configuration (in sanity.config.ts or a separate structure file), look for anything specific to the problematic document type:

Inspect Network Traffic During Deletion

This is your best diagnostic tool. Open browser DevTools → Network tab, then delete the draft. Watch for:

Filter the network requests to just show calls to api.sanity.io to reduce noise.

Check for Document-Level Subscriptions

Look through your codebase for anything that might be subscribing to or maintaining a reference to documents of that type:

Known Studio Quirks

There have been reports of Studio's presence system (which tracks who's editing what) sometimes causing unexpected behavior with drafts, though this is rare. The fact that the restored document has the same ID as the original is expected (drafts use drafts.{id} as their document ID), but the restoration itself is not normal behavior.

The network inspection is really your best bet here - it will show you exactly what operation is recreating the document and that will point you to the source of the problem in your configuration.

Have you noticed if the "restored" document appears immediately after deletion, or does it take a few seconds? That timing might also provide clues about whether it's a synchronous operation in your Studio code vs. something async.

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