How are attributes counted when reusing custom object types in Sanity?
In your example, you would have 6 unique attributes counting toward your limit.
Here's how Sanity counts attributes based on the attribute limit documentation:
An attribute is defined as a unique combination of path and datatype through your content. Think of it as the different paths through your documents. What matters is the structure, not how many times you use it.
For your familyMembers document with the nameFull object used twice:
yourName→ objectyourName.firstName→ stringyourName.lastName→ stringyourFathersName→ objectyourFathersName.firstName→ stringyourFathersName.lastName→ string
Since yourName and yourFathersName are different field names, they create separate paths. Even though they're both using the same nameFull object type, each field name creates its own unique path through your content structure.
Key things to understand:
- Each unique path is counted once, regardless of how many documents use it
- Different field names create different paths, even when using the same object type
- If you had used an array of
nameFullobjects instead (likenames[]), you'd only have 3 attributes:names(array),names[].firstName(string), andnames[].lastName(string) - because array items share the same path pattern - Attributes only count when they hold actual content - just defining them in your schema doesn't increase the count
The good news: If you had 100 documents all using this same structure, it would still be just 6 attributes. The count doesn't multiply by the number of documents.
Plan limits:
- Free: 2,000 attributes
- Growth: 10,000 attributes
- Enterprise: Custom
To check your current usage, visit: https://<projectId>.api.sanity.io/v1/data/stats/<datasetName> and look at fields.count.value.
If you're concerned about hitting limits, consider best practices like using arrays for repeated structures (which share paths), avoiding excessive nesting, and being mindful of field-level translation approaches that can multiply your attribute count.
Show original thread15 replies
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.