Can the "Publish" button text be changed to "Save" in Sanity.io?
You can customize the "Publish" button text by overriding the default PublishAction in your Studio configuration. Here's how to do it:
First, create a custom document actions resolver. In your Studio config folder, create a file (e.g., customDocumentActions.ts or customDocumentActions.js):
import {PublishAction} from 'sanity'
// Custom publish action with different label
const CustomPublishAction = (props) => {
const defaultPublishAction = PublishAction(props)
return {
...defaultPublishAction,
label: 'Save' // Change the button text here
}
}
export default function resolveDocumentActions(props) {
// Replace the default PublishAction with your custom one
return [CustomPublishAction]
}Then, add this resolver to your sanity.config.ts:
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import resolveDocumentActions from './customDocumentActions'
export default defineConfig({
// ... other config
document: {
actions: resolveDocumentActions
}
})If you want to keep all the other default actions (like Unpublish, Delete, etc.) alongside your custom "Save" button, modify the resolver like this:
import {PublishAction} from 'sanity'
import defaultResolve from 'sanity'
const CustomPublishAction = (props) => {
const defaultPublishAction = PublishAction(props)
return {
...defaultPublishAction,
label: 'Save'
}
}
export default function resolveDocumentActions(props) {
return defaultResolve(props).map((Action) =>
Action === PublishAction ? CustomPublishAction : Action
)
}This approach lets you customize document actions while maintaining all the built-in functionality of the publish action—just with different button text!
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.