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

Sanity Attribute Limit: Do Duplicate Field Names in Different Documents Count Separately?

5 repliesLast updated: Dec 1, 2025

Hi there,I need a help regrading attribute limit count . As I have reached my max limit of 4k in sanity so just need to confirm one thing regarding unique paths

Let's say I have 2 documents and in each document fields are almost same but they are nested under different objects .

For Example:-
1.
Page1:{ title:'Sanity' ,subtitle:'Sanity'}
2.
Page2:{title:'Sanity' , subtitle:'Sanity'}
So in the above example the attribute count would be 6 or is it 3 ?
AI Update

Great question about how Sanity counts unique attribute paths! Let me clarify this for you based on the official documentation on attribute limits.

In your example with two documents:

Page1: { title: 'Sanity', subtitle: 'Sanity' }
Page2: { title: 'Sanity', subtitle: 'Sanity' }

The answer is more than 3 - it would be approximately 4-6 attributes depending on the system fields.

Here's the key principle: Sanity counts unique paths, not individual field instances. According to the documentation, a path is counted based on its unique combination of attribute name and datatype. The documentation provides this example:

{
  "foo": [
    {
      "bar": ...,
      "baz": ...
    },
    {
      "bat": {
        "bar": ...
      }
    }
  ]
}

This structure contains six unique paths:

For your specific example:

In your two documents, you'd have:

Plus potentially other system fields like _createdAt, _updatedAt, etc.

The crucial point: Even though you have TWO documents with the same fields, each unique path is only counted once. Using the same field across 1 document or 1,000 documents doesn't increase your attribute count.

Important clarifications:

If you're hitting your 4K limit:

You can check your current attribute count at: https://<projectId>.api.sanity.io/v1/data/stats/<datasetName> (look for fields.count.value)

Common causes of hitting the limit include:

Consider using document-level localization instead of field-level, and arrays instead of deeply nested objects for page builders to keep your attribute count manageable.

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