How are attributes counted when reusing custom object types in Sanity?

15 replies
Last updated: Dec 1, 2025
I'm a little confused by how the attributes limit is determined. Really, I'm just a little confused what an attribute actually is. Let's say I have and object called
nameFull
and it has two string fields
firstname
and
lastName
This object is in my document twice, one reference has the name
yourName
and the other has the name
yourFathersName
. How many unique attributes would this be? I'll show a rough example:
Document:

{
type: "document",
name: "familyMembers",
fields: [
  {
    name: "yourName",
    type: "nameFull"
  },
  {
    name: "yourFathersName",
    type: "nameFull"
  },
]
}
nameFull Object:

{
type: "object",
name: "nameFull",
fields: [
  {
    name: "firstName",
    type: "string"
  },
  {
    name: "lastName",
    type: "string"
  }
]
}
AI Update

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:

  1. yourName → object
  2. yourName.firstName → string
  3. yourName.lastName → string
  4. yourFathersName → object
  5. yourFathersName.firstName → string
  6. yourFathersName.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 nameFull objects instead (like names[]), you'd only have 3 attributes: names (array), names[].firstName (string), and names[].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 thread
15 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.

Was this answer helpful?