Make sure your team puts the tools down during critical moments. This plugin disables create, update, and delete operations across specified collections and globals when a content freeze is active.
content-freeze.mov
- Deployment freezes: Prevent content changes during critical deployments.
- Marketing campaigns: Lock content before major campaigns go live.
- Audit periods: Freeze content during compliance audits.
- Release management: Coordinate content changes with software releases.
- Emergency situations: Quickly lock down your CMS when needed.
- Install the plugin:
pnpm add @payload-bites/content-freeze- Add the plugin to your
payload.config.ts:
import { contentFreezePlugin } from "@payload-bites/content-freeze";
export default buildConfig({
// ...
plugins: [
// ...
contentFreezePlugin({
// optional but recommended for custom access control
overrideContentFreezeSettingsGlobal: (global) => ({
...global,
access: {
...global.access,
read: ({ req }) => req.user?.role === "admin",
update: ({ req }) => req.user?.role === "admin",
},
}),
}),
// ...
],
// ...
});- Navigate to the Content freeze settings global in your admin panel.
- Select the collections and/or globals you would like to be placed under content freeze.
- Optionally, add a custom message to display in the banner.
- Check the Enable content freeze checkbox.
- Save the global.
A banner will appear at the top of all admin screens, and create/update/delete operations will be blocked on the selected collections and globals.
- Navigate to the Content freeze settings global.
- Uncheck the Enable content freeze checkbox.
- Save the global.
The banner will disappear and normal usage can resume.
For all available options, refer to types.ts.
For default values, refer to defaults.ts.
When the content freeze is active:
- Collections: Create, update, and delete operations are blocked.
- Globals: Update operations are blocked.
- Settings global: Remains accessible to authorized users so they can deactivate the freeze.
- Banner: Displays across all admin screens with your custom message.
The plugin wraps existing access controls, so your original access rules are still evaluated when the freeze is not active.
- Translations.
- Scheduled publish of content freeze.