Skip to main content

Draft & Publish

The Draft & Publish feature allows to manage drafts for your content.

Identity Card of the Feature

Plan: Free feature.
Role & permission: None.
Activation: Available but disabled by default.
Environment: Available in both Development & Production environment.

Editing draft versionEditing draft version

Configuration

Path to configure the feature: CTB icon Content Type Builder

For your content types to be managed with Draft & Publish in the Content Manager, the feature must be enabled through the Content-type Builder. Draft & Publish can be configured for each content type.

To enable Draft & Publish:

  1. Either edit an already created content type of your choice, or create a new content type (see Content Type Builder documentation for more information).
  2. Go to the Advanced settings tab.
  3. Tick the Draft & Publish option.
  4. Click the Finish button.
Content-type Builder's advanced settingsContent-type Builder's advanced settings

Usage

With Draft & Publish enabled, the Content Manager's edit view indicates the current status of your content type's entry at the top of the interface. Your content can have 3 statuses:

  • Published: The content was previously published. There are no pending draft changes saved.
  • Modified: The content was previously published. You made some changes to the draft version and saved these changes, but the changes have not been published yet.
  • Draft: The content has never been published yet.

Working with drafts

Path to use the feature: Content icon Content Manager, edit view of your content type

While editing a document, you can see 2 tabs:

  • The Draft tab is where you can edit your content.
  • The Published tab is a read-only tab where edition of all fields is disabled. The Published tab only exists to show what is the content of fields in the published version.
Editing draft versionEditing draft version

By default, each newly created content is a draft. Drafts can be modified and saved at will, using the Save button in the Entry box on the right side of the interface, until they are ready to be published.

Once you made changes to a draft, you have 3 possible options, all available in the Entry box on the right side of the interface:

  • Publish your document (see publishing a draft),
  • Save your draft for later retrieval,
  • or discard changes, by clicking on More icon and choosing Discard changes icon Discard changes.

Publishing a draft

Path to use the feature: Content icon Content Manager, edit view of your content type

To publish a draft, click on the Publish button in the Entry box on the right side of the interface.

After a draft is published:

  • The content of the Draft and Published tabs should be exactly the same (but the Published tab remains read-only).
  • The status, below the document's title, will switch to "Published".
Caution

Before publishing a draft, make sure it doesn't have relations with other non-published content, otherwise some of the content may not be available through the API.

When a document has both a draft and a published version available, the published version can be found in the Published tab. If the document has only a draft version, you can not click on the Published tab.

Editing published versionEditing published version
Tip

To schedule publication, i.e., convert a draft to a published entry at a given date and time, you can include it in a release and schedule the publication of the release.

Unpublishing content

Path to use the feature: Content icon Content Manager, edit view of your content type

To unpublish a previously published content: from the Draft tab, click on More icon in the Entry box on the right side of the interface and choose the Unpublish button.

If the draft version of the document contains content different from the published version, you can decide what to do with both content when unpublishing:

  1. From the Draft tab, click on More icon in the Entry box on the right side of the interface and choose the Unpublish button.
  2. In the Confirmation dialog that opens, you can choose to:
    • Unpublish and keep last draft, so that all the content you currently have in the Draft tab is preserved, but the all the content from the Published tab is definitely gone
    • Unpublish and replace last draft to discard any existing content in the Draft tab and replace it with the content of all fields from the Published tab
  3. Click Confirm. The desired changes will be applied to both the Draft and Published tabs and the new status of the entry will also be reflected below the entry title.
Unpublish a documentUnpublish a document

Bulk actions

Path to use the feature: Content icon Content Manager, list view of your content type

Selecting multiple entries from the Content Manager's list view will display additional buttons to publish or unpublish several entries simultaneously. This is what is called "bulk publishing/unpublishing".

Caution

If the Internationalization plugin is installed, the bulk publish/unpublish actions only apply to the currently selected locale.

Unpublish a documentUnpublish a document

Bulk publishing drafts

To publish several entries at the same time:

  1. From the list view of the Content Manager, select your entries to publish by ticking the box on the left side of the entries' record.
  2. Click on the Publish button located above the header of the table.
  3. In the Publish entries dialog, check the list of selected entries and their status:
    • Success icon Ready to publish: the entry can be published
    • Fail icon "[field name] is required", "[field name] is too short" or "[field name] is too long": the entry cannot be published because of the issue stated in the red warning message.
  4. (optional) If some of your entries have a Edit icon status, click the Edit icon edit buttons to fix the issues until all entries have the Success icon Ready to publish status. Note that you will have to click on the Refresh button to update the Publish entries dialog as you fix the various entries issues.
  5. Click the Publish button.
  6. In the confirmation dialog box, confirm your choice by clicking again on the Publish button.

Bulk unpublishing content

To unpublish several entries at the same time:

  1. From the list view of the Content Manager, select your entries to unpublish by ticking the box on the left side of the entries' record.
  2. Click on the Unpublish button located above the header of the table.
  3. In the confirmation dialog box, confirm your choice by clicking again on the Unpublish button.

Usage with APIs

Draft or published content can be requested, created, updated, and deleted using the status parameter through the various front-end APIs accessible from Strapi's Content API:

On the back-end server of Strapi, the Document Service API can also be used to interact with localized content: