Draft system
How the editor uses Payload drafts, what Save, Publish and Unpublish do, and how homepage changes are applied.
The editor uses Payload's native draft system. The plugin enables drafts on the pages collection for you, both when it generates the collection and when it adds fields to an existing one. To enable it on a collection yourself:
{
slug: 'pages',
versions: {
drafts: true,
},
}From 0.11.0, the generated pages collection defaults to published-only reads for anonymous callers, including requests with draft=true. Authenticated Payload users can read drafts. If you turn drafts off (collectionOverrides: { versions: { drafts: false } }), every save is live and anonymous callers can read every page. Your own access.read overrides this default, and collections you define yourself keep their access rules. See Upgrading for the change and explicit opt-out.
The editor header provides:
- Save: saves a draft without publishing.
- Publish: publishes the page (sets
_status: 'published'). - Unpublish: reverts a published page to draft status. It appears only when the page is published.
When a versions endpoint is available (the built-in endpoints include one), the editor also shows a History button for browsing and restoring earlier versions.
The homepage
Only one page can be the homepage. A beforeChange hook on the collection enforces it.
Homepage changes take effect on publish
Saving a draft never changes the live homepage, so you can mark a draft as the homepage without the current one disappearing. When you publish it, the editor asks to swap: the new page becomes the homepage and the previous one is unset, together, in one transaction.
On a collection without drafts every save is live, so the uniqueness check and swap apply on each save.
To add the hook to a collection you define yourself, use createIsHomepageUniqueHook() or getPuckCollectionConfig(); see Existing projects.

