Where to organize document schemas in Sanity Studio folder structure?

18 replies
Last updated: Jan 28, 2026
Need some advice here. I have this folder structure of the studio where basically almost everything is inside the “documents” folder. I want to cleanup the folder and make it more readable and logical.
Any tips ? Where would you move the docs in which folder because it can be pretty tough somethimes
😄
AI Update

Great question! Organizing your Sanity Studio folder structure can definitely get messy as projects grow. While Sanity doesn't enforce a strict folder structure (since everything is schema-as-code), here are some practical patterns that work well:

Common Folder Structure Patterns

Group by content type categories:

schemas/
├── documents/         # Top-level content types
│   ├── page.ts
│   ├── post.ts
│   └── author.ts
├── objects/          # Reusable nested objects
│   ├── seo.ts
│   ├── hero.ts
│   └── cta.ts
├── blocks/           # Portable Text blocks
│   ├── customImage.ts
│   └── callout.ts
└── singletons/       # One-off documents
    ├── settings.ts
    └── navigation.ts

Or group by feature/domain:

schemas/
├── blog/
│   ├── post.ts
│   ├── category.ts
│   └── author.ts
├── commerce/
│   ├── product.ts
│   └── collection.ts
├── pages/
│   ├── page.ts
│   └── landingPage.ts
└── shared/
    ├── seo.ts
    └── media.ts

Key Organization Tips

Separate by schema type hierarchy:

  • Documents (type: 'document'): Top-level content that appears in your desk structure
  • Objects (type: 'object'): Reusable components that nest inside documents
  • Singletons: Documents that should only have one instance (site settings, global config)

Consider what editors see: Your folder structure doesn't affect the Studio UI that editors see - that's controlled by your Structure tool configuration. So organize files for developer clarity, not editor experience.

Keep related schemas together: If a schema is only used by one document type, consider keeping them in the same folder or file.

Use an index file: Create an index.ts in your schemas folder that imports and exports all schema types. This gives you one place to manage what's registered in your Studio.

The beauty of Sanity's schema-as-code approach is there's no "wrong" answer - it's just JavaScript/TypeScript files. Pick a structure that makes sense for your team's mental model and refactor as needed. The schemas will work the same regardless of folder organization!

Most teams find the first pattern (documents/objects/blocks/singletons) works well as a starting point, then add domain-specific folders as the project grows. Good luck with the cleanup! 😄

Show original thread
18 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?