๐Ÿ—“๏ธ Everything *[NYC] is back. A free gathering for AI builders. Sept 9 โ†’

Do different document types with same field name count as separate attributes?

3 repliesLast updated: Nov 29, 2025

Hello all,w.r.t the Sanity attribute limit.

https://www.sanity.io/docs/attribute-limit
I understand that it's based on unique paths that hold content.
But do different document types duplicate this?

i.e. say I have two document types
page
and
post

They both have a
body
field which are both a string.
Would that field count as 2 attributes? or 1 attribute?

Thanks
๐Ÿ™‚
AI Update

Great question! The attribute limit is based on unique paths across your entire dataset, not per document type. So to answer your question directly:

The body field would count as 2 attributes because they exist at different paths in your content structure:

Even though both fields have the same name and are the same type (string), they're at different locations in your content hierarchy, so Sanity counts them as separate unique paths.

How attributes are counted

According to the attribute limit documentation, an attribute is defined as a unique combination of path and datatype. Think of it as all the different routes through your content structure.

For example, if you have:

page {
  body: string
  title: string
}

post {
  body: string
  author: string
}

This creates 4 attributes:

Important things to know

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

If you're concerned about hitting the limit, the docs recommend focusing on semantic content structure rather than presentation, avoiding excessive nesting, and being mindful of localization approaches that can multiply your attribute count.

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