How AI is powering better personalization in e-commerce [with Vercel]. Sign up now

Hide document types from "Create new document" button in Sanity Studio

25 repliesLast updated: Nov 29, 2025

Hello. Is there anyway to hide/remove/filter specific document types from this main “Create a new document” button at the top left of the studio?
AI Update

Yes! You can absolutely hide specific document types from the "Create new document" button using the newDocumentOptions configuration in your Studio config.

In your sanity.config.ts (or .js) file, you can add a document.newDocumentOptions function that filters which document types appear in the global create menu. Here's how:

import { defineConfig } from 'sanity'

export default defineConfig({
  // ... other config
  document: {
    newDocumentOptions: (prev, { currentUser, creationContext }) => {
      // Filter out specific document types
      return prev.filter(
        (template) => !['documentTypeToHide', 'anotherTypeToHide'].includes(template.templateId)
      )
    },
  },
})

You can also make this context-aware. For example, if you want to hide certain types only in specific places (like in the Structure tool but not in other contexts):

document: {
  newDocumentOptions: (prev, { currentUser, creationContext }) => {
    const { type, schemaType } = creationContext;
    
    // Hide 'pet' documents only when creating from Structure tool
    if (type === 'structure' && schemaType === 'pet') {
      return [];
    }
    
    return prev;
  },
}

The newDocumentOptions function receives:

This is particularly useful for:

You can find more details and examples in the newDocumentOptions recipe and the Studio customizations guide.

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