Compare document versions
The document comparison view in Sanity Studio provides a side-by-side view of different document versions.
Prerequisites
- Sanity Studio v3.78.0 or later, which added the document comparison view.
- A document with at least two versions to compare, such as a draft and a published document.
- To compare a version that belongs to a release, Content Releases must be enabled in your studio.
Side-by-side comparison
Use the document comparison view to compare document versions. This includes drafts, published, and release versions. To get started, open a document in Sanity Studio that contains multiple document versions.
- In the top right corner of the document view, click the ... icon.
- Select Compare versions.
The document comparison view opens over your studio window. It contains a version selector and two panels, one for each version you compare.
Gotcha
This view only works when multiple document versions exist. If Compare versions is disabled, its tooltip reads "There are no other versions of this document to compare." — make a change to a draft or release version in addition to the published version.
Differences between the fields in the right version are highlighted in yellow. You may recognize this from other history or diff tools. In the screenshot, the Overview field has a yellow highlight along its edge to indicate changes.
You can adjust the compared versions with the version selector at the top of the window.
Protip
You cannot leave comments or tasks from within the comparison view. It's best to save major changes and workflows for the document view.
Advanced Version Control
Experimental feature
This functionality is likely to change as we improve and expand it. Let us know if you have any feedback.
Advanced Version Control adds inline diff annotations to fields, letting editors see how content has changed between versions while they work on it. This functionality is available for string fields and Portable Text fields.
Switching on Advanced Version Control
To switch on Advanced Version Control, set the advancedVersionControl.enabled configuration option to true. This feature can be switched on or off for different workspaces.
import {defineConfig} from 'sanity'
export default defineConfig({
advancedVersionControl: {
enabled: true,
},
// …
})Editors must also switch on inline annotations per document. In the document's Show more menu (the ... button in the top right of the document pane), select Inline changes. The setting persists as you navigate.



