Developer builds three-action unpublish and archive workflow in Sanity CMS
A developer has shared a custom content lifecycle workflow built for Sanity CMS client projects, replacing the default single unpublish action with three distinct actions: Unpublish, Archive, and Restore. The approach avoids permanent deletion by keeping all documents in the dataset and using a hidden status field to control visibility on the front end. Archiving a document unpublishes it and flags it with a status of 'archived', allowing the front end to serve a 404 or redirect rather than live content. A Restore action flips the status back to 'active' without auto-publishing, giving editors control over when content goes live again. The workflow is scoped to specific content types such as posts, pages, and case studies via Sanity's document actions API.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in