
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeGreat question! Yes, you can absolutely trigger a Netlify redeploy when your Sanity content changes. Let me walk you through your best options.
The most reliable, production-ready way to trigger Netlify builds is using Sanity's GROQ-powered webhooks. This is the official, mature feature designed exactly for this use case. Here's how it works:
Get your Netlify build hook URL: In Netlify, go to Site Settings → Build & deploy → Build hooks, and create a new build hook. You'll get a URL like https://api.netlify.com/build_hooks/YOUR_HOOK_ID
Set up the webhook in Sanity: Go to your Sanity project dashboard → API → Webhooks → Create webhook
Configure it:
!(_id in path("drafts.**")) will only trigger on published documents, not draftsThe webhooks documentation has excellent guides on using filters and projections to fine-tune exactly when your webhook fires.
The Netlify plugin you mentioned (also known as "Netlify Deploy" or sanity-plugin-netlify) is perfect if you want manual control over deployments. It adds a deploy tool to your Studio where editors can:
Install it with:
npm install sanity-plugin-netlifyThen add it to your sanity.config.ts:
import { defineConfig } from 'sanity'
import { netlifyTool } from 'sanity-plugin-netlify'
export default defineConfig({
// ...
plugins: [
netlifyTool(),
],
})This approach is great for avoiding unnecessary builds on every content save, and gives content editors visibility into deployment status directly in Studio.
Avoid build storms: Don't trigger on every single save. Consider:
!(_id in path("drafts.**")) to only trigger on published documents_type == "post"Security: Keep your Netlify build hook URL private - anyone with it can trigger builds
Editor experience: The dashboard widget gives editors clear feedback about deployment status, which webhooks alone don't provide
For most production sites, I'd suggest:
Or use just the dashboard widget if you want full editorial control and to minimize build usage.
The webhook + widget combo gives you the best of both worlds: automatic deploys for published content, plus visibility and manual control when needed. Check out this community answer for a real-world walkthrough of the setup process.
Quick webhook setup example:
https://api.netlify.com/build_hooks/YOUR_HOOK_ID!(_id in path("drafts.**")) (ignores drafts)This will trigger a Netlify rebuild whenever you publish content in Sanity!
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