User encounters issue with duplicate page slug in Sanity Studio
I've seen this issue before! You're dealing with an unpublished draft that's "invisible" but still taking up the slug. Here's what's happening and how to fix it:
What's Going On
When you duplicated the page, Sanity created a draft document (even though you didn't publish it). In Sanity, drafts have IDs prefixed with drafts. - so if your original page ID is page-123, the duplicate draft is drafts.page-456. These drafts exist in your Content Lake even if you navigate away without publishing them.
The problem is that your duplicate draft is using the same slug as the original, and Sanity's slug validation is catching this conflict - even though you can't see the draft in your normal document list view.
How to Find and Fix It
Option 1: Use Vision (GROQ Playground)
- Open the Vision tool in your Studio (usually in the top navigation)
- Run this query to find all drafts:
*[_id in path("drafts.**")] - Look for your duplicate page in the results
- Once you find it, you can delete it directly from the Studio by opening it (copy its
_idand paste it in your browser's URL bar:your-studio-url/desk/page-id)
Option 2: Search by Slug
In Vision, search specifically for documents with that slug:
*[slug.current == "your-slug-here"]This will show you both the published document AND the draft that's causing the conflict.
Option 3: Use the "Review Changes" Feature
If your Studio has the Review Changes feature enabled, you might be able to see pending drafts there and discard them.
Prevention Tips
- Always delete test duplicates before navigating away, even if unpublished
- Consider adding a different slug immediately when duplicating to avoid conflicts
- Remember that drafts persist in Sanity until explicitly deleted - navigating away doesn't remove them
The slug validation is actually protecting you from having multiple pages with the same URL, but it can be confusing when the conflicting document isn't visible in your normal workflow!
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.