Draft & Publish is always enabled in Strapi v5
In Strapi 5, the Draft & Publish feature is always enabled.
This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.
Breaking change description
In Strapi v4
Content types had a draftAndPublish
option in their schema. The database schema and admin panel interface changed depending on that option.
In Strapi 5
All content-types now have Draft & publish enabled in the database and in the admin panel interface. The admin panel interface also will be changing.
Migration
This section regroups useful notes and procedures about the introduced breaking change.
Notes
Strapi provides a codemods to automatically update all the content-type schemas that are detected by the
strapi upgrade
tool.Plugin developers and users with custom content-types should update content-types.
A safety net is provided to avoid breaking changes that would force manual intervention and to avoid breaking the whole Strapi plugins ecosystem:
- A default
publishedAt
value is set. - The
draftAndPublish: true
option can still be present in v5 content-types schemas, but will be ignored.
- A default
Manual procedure
This procedure is only required if the codemods failed to remove the line automatically.
To manually update Strapi v4 code to Strapi v5, update the schema.json
files of your content-types to remove the draftAndPublish: true
option line:
{
"options": {
"draftAndPublish": true // delete the entire line
}
}