
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI feel your pain – this is a classic mistake that's bitten many developers! The good news is that Sanity does support patterns that can prevent this exact scenario, though they might not be immediately obvious.
Your second suggestion is actually already supported. You can deploy multiple Studio instances to different subdomains on Sanity's hosting, each permanently configured for a specific dataset. This is the recommended approach and doesn't cost extra.
Here's how it works: When you run sanity deploy, you're prompted to choose a hostname. You can deploy multiple times with different configurations:
# In your sanity.config.ts, use environment variables
export default defineConfig({
projectId: 'your-project-id',
dataset: process.env.SANITY_STUDIO_DATASET || 'production',
// ... rest of config
})Then deploy separate instances:
# Deploy production Studio
SANITY_STUDIO_DATASET=production sanity deploy
# When prompted, enter hostname: acme-production
# Deploy development Studio
SANITY_STUDIO_DATASET=development sanity deploy
# When prompted, enter hostname: acme-developmentThis gives you acme-production.sanity.studio and acme-development.sanity.studio as permanent, separate URLs. Each deployment is locked to its dataset configuration – no chance of forgetting to redeploy because you never change the production Studio's config. This approach is covered in the multi-environment deployments guide and the setting up your environments course.
For a visual safety net, you can add a banner showing which dataset is active. Using Studio's configuration API with defineConfig, you can customize the navbar:
import { defineConfig } from 'sanity'
const datasetBanner = () => {
const dataset = process.env.SANITY_STUDIO_DATASET || 'production'
return (
<div style={{
background: dataset === 'production' ? '#f03e2f' : '#f59e0b',
color: 'white',
padding: '8px',
textAlign: 'center',
fontWeight: 'bold',
fontSize: '14px'
}}>
⚠️ {dataset.toUpperCase()} DATASET
</div>
)
}
export default defineConfig({
// ... your config
studio: {
components: {
navbar: (props) => (
<>
{datasetBanner()}
{props.renderDefault(props)}
</>
)
}
}
})There are also community plugins that add environment badges, though you'll want to verify Studio v3 compatibility.
The best practice combines both approaches:
acme-production.sanity.studio is permanently configured for production, eliminating the "forgot to redeploy" problem entirely.env files locally (.env.development, .env.production) so developers automatically work with the right dataset when running sanity dev or sanity buildThis way, there's no deployment step that could be forgotten. Your team always knows which URL to use, and the mistake you experienced becomes architecturally impossible.
You might also consider Workspaces, which let you configure multiple datasets within a single Studio deployment with a built-in switcher. However, this doesn't solve your specific problem – you'd still need to remember to deploy after changing configuration. Workspaces are better suited for multi-tenant scenarios or when you want editors to easily switch between datasets, not for preventing deployment mistakes.
The separate deployment approach is really the gold standard here – it turns your configuration mistake into an impossibility rather than relying on memory or visual cues.
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store