Is there any way of hiding a document (that you call from another document) from the sanity studio left nav?
Yes! You can definitely hide specific document types from the Structure Tool's left navigation. This is commonly needed when you have documents that should only be referenced from other documents (like reusable content blocks or metadata) but don't need their own top-level navigation.
The key is to customize the Structure Tool using the Structure Builder API. Here's how to do it:
Basic Approach: Filter Document Types
In your sanity.config.js (or .ts), customize the Structure Tool to explicitly control which document types appear:
import { structureTool } from 'sanity/structure'
import { defineConfig } from 'sanity'
export default defineConfig({
// ... other config
plugins: [
structureTool({
structure: (S) =>
S.list()
.title('Content')
.items([
// Explicitly list the document types you WANT to show
S.documentTypeListItem('post').title('Blog Posts'),
S.documentTypeListItem('author').title('Authors'),
// 'reusableBlock' is omitted, so it won't appear in the nav
])
})
]
})Filter Out Specific Types
If you have many document types and only want to hide a few, you can filter the default list:
structureTool({
structure: (S) =>
S.list()
.title('Content')
.items([
// Get all default document type list items except the ones you want to hide
...S.documentTypeListItems().filter(
(listItem) => !['reusableBlock', 'seoMetadata'].includes(listItem.getId())
)
])
})This approach uses S.documentTypeListItems() to get all your schema types, then filters out the ones you don't want visible in the left nav.
Why This Works
When you reference these hidden documents from other documents (using reference fields), they're still fully functional—editors can still create and edit them through the reference picker or by navigating directly via URL. They just won't clutter your main navigation.
The Structure Tool is extremely flexible, so you can also create custom groupings, nested lists, and filtered views to organize your content exactly how your editors need it. Check out the Structure Builder guide for more advanced customization options.
Show original thread11 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.