This Friday: Hear from Sanity + Vercel experts on AI and better personalization in e-commerce

How to delete Home and About pages in Sanity when getting an error

48 repliesLast updated: Nov 29, 2025

Hello there, how can i delete these Home and About pages from sanity, i am unable to do it, due to this error
AI Update

This is a common issue in Sanity! You're getting this error because the Home and About pages you're trying to delete are referenced by other documents in your content. Sanity prevents you from deleting documents that have strong references pointing to them - this is a security feature that protects your content integrity.

Finding Which Documents Are Referencing Your Pages

The easiest way to find what's referencing your pages is to use Vision (Sanity's GROQ playground):

*[references("YOUR_DOCUMENT_ID")]

Replace YOUR_DOCUMENT_ID with the actual _id of your Home or About page. You can find the document ID by opening the document in Studio and checking the "Inspect" panel.

Alternatively, you can use this more detailed query that shows you which documents have references:

*[]{_id, title, "references": *[references(^._id)]}[length(references) > 0]

This will show you all documents and what's referencing them.

Removing the References

Once you know which documents are referencing your pages, you have several options:

Based on discussions in the Sanity community, common places where references hide include:

Making References "Weak" (Future Prevention)

If you want to allow deletion even when references exist, you can modify your schema to use weak references:

{
  name: 'pageReference',
  type: 'reference',
  weak: true, // This allows the referenced document to be deleted
  to: [{type: 'page'}]
}

With weak references, Sanity won't block deletion - though the referencing documents will have broken links.

The Vision query is your best tool here for tracking down exactly what's holding onto those references. Once you clean those up, you'll be able to delete the Home and About pages without issues!

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