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

How to reduce attribute count by removing content in Sanity project?

6 repliesLast updated: Nov 30, 2025

Hi there 👋 I have reached the attribute limit on a project. I am trying to remove some content we no longer need in the hope it will bring the attribute count down, but isn’t going down. Am I missing the point of attributes here? Any suggestions would be great, thank you 🙏
AI Update

You're not missing the point of attributes - you've actually identified a key behavior that can be confusing! Let me explain what's happening and how to fix it.

Why deleting content isn't reducing your attribute count

According to the attribute limit documentation, attributes work differently than you might expect:

Your attribute count:

The key issue: Each unique path is counted once, no matter how often it's used. Removing a path from your attribute count requires deleting every piece of content on that path across all documents in your dataset - not just some documents.

So if you deleted a few documents but other documents still contain those same field paths, your attribute count won't decrease.

How to actually reduce your attribute count

Here's what you need to do:

1. Export your data first (critical!)

Before making any changes, run a full export:

sanity dataset export production production.tar.gz

2. Track your progress

Monitor your attribute count using this URL:

https://<projectId>.api.sanity.io/v1/data/stats/<datasetName>

Look for fields.count.value (current count) and fields.count.limit (your limit).

3. Identify and remove unused paths

You need to remove content from paths that are no longer needed. This might include:

The content must be removed from every document that contains those paths, including drafts (documents with drafts. prefix in their ID).

4. Consider restructuring

If you're still hitting limits, you may need to restructure your content model. Common issues that inflate attribute counts:

Check out the best practices section in the docs for detailed guidance on avoiding these pitfalls.

Hope this helps! Let me know if you need help identifying which paths are consuming your attributes.

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