How to structure Sanity schema for different fields per page?

9 replies
Last updated: Jan 27, 2026
Hello everyone! Needed help here.
I would like to ask something regarding the schema structure for Sanity.

I am building a mini-site for a client with few pages and I would like to create specific fields for each page, so when my client need to change the content, they just need to open the Sanity Studio online and change it from there.

So for each page, there will be specific fields. Not the kind of blog where each article contains the same field (title, author, image, etc).

How do you think I should create the schema? Do I have to create a document for every page and create 1 post? Or can I create a specific post which contains specific fields in Sanity?

Thanks in advance! Have a great day everyone.
AI Update

Perfect! This is exactly what you need - singleton documents are the ideal solution for your use case.

Since you're building a mini-site where each page has unique, specific fields (not repeating blog-style content), you should create a separate document schema for each page and configure them as singletons. This means each page type will only ever have one instance in your dataset.

Here's how to approach it:

Create a document schema for each page with its specific fields. For example:

// schemas/homePage.js
export default {
  name: 'homePage',
  title: 'Home Page',
  type: 'document',
  fields: [
    {
      name: 'heroTitle',
      type: 'string',
      title: 'Hero Title'
    },
    {
      name: 'heroImage',
      type: 'image',
      title: 'Hero Image'
    },
    // ... other fields specific to home page
  ]
}

// schemas/aboutPage.js
export default {
  name: 'aboutPage',
  title: 'About Page',
  type: 'document',
  fields: [
    {
      name: 'companyHistory',
      type: 'text',
      title: 'Company History'
    },
    // ... other fields specific to about page
  ]
}

Configure them as singletons in your sanity.config.js to prevent creating multiple instances. The singleton document pattern requires three configurations:

  1. Structure Builder - creates direct links to each page
  2. Template filtering - removes these from the "New document" menu
  3. Document actions - removes duplicate/delete actions

The easiest way is to use the sanity-plugin-singleton-tools plugin, which handles all this configuration automatically.

Important: Create one instance of each document in the Studio BEFORE configuring them as singletons. Once configured, the UI to create new instances will be disabled.

This approach gives your client a clean, organized Studio interface where they can click directly into "Home Page", "About Page", etc., and edit the specific fields for each page without any confusion about creating/managing multiple posts.

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