Joint session with Vercel: How to build intelligent storefronts (May 15th)

Unpublished duplicate page causing "slug in use" error

2 repliesLast updated: Nov 29, 2025

Hi all, new to Sanity Studio. I duplicated a page to try out some changes I want to make to the original. I didn't publish the duplicate - just viewed the edits in preview. I clicked to another page, but now I can't seem to find the duplicate page in my studio. Now if I try to make any edits to the original, I get an error that the slug is in use. Curious if anyone has seen this before?
AI Update

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)

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

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!

Show original thread
2 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