Saving, publishing and deleting content
Strapi allows you to manage your content throughout its whole lifecycle, whether you are working on its draft version, about to finish it and share it with the world, or wanting to delete it when it's obsolete.
Saving & publishing content
The possibility to manage drafts for contents comes from the Draft & Publish feature. This feature is activated by default, but it can be deactivated for any content-type from the Content-type Builder (see advanced settings for content-types). If you disabled the Draft & Publish feature, saving your content means saving and publishing at the same time.
Your content can have 3 statuses:
Status name | Description |
---|---|
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. |
In the Content Manager edit view (the view you see when editing an entry), the current status of an entry is indicated at the top of the interface, just below the entry title.
Working with drafts
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.
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 and choosing Discard changes.
Publishing and unpublishing
While editing a document, you can decide to publish a draft or unpublish previously published content.
Publishing a draft
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".
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.
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
Previously published content can be unpublished.
To unpublish content, from the Draft tab, click on 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:
- From the Draft tab, click on in the Entry box on the right side of the interface and choose the Unpublish button.
- 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
- 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.
Bulk publishing and unpublishing
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".
If the Internationalization plugin is installed, the bulk publish/unpublish actions only apply to the currently selected locale.
Bulk publishing drafts
To publish several entries at the same time:
-
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.
-
Click on the Publish button located above the header of the table.
-
In the Publish entries dialog, check the list of selected entries and their status:
- Ready to publish: the entry can be published
- "[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.
-
(optional) If some of your entries have a status, click the edit buttons to fix the issues until all entries have the 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.
-
Click the Publish button.
-
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:
- 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.
- Click on the Unpublish button located above the header of the table.
- In the confirmation dialog box, confirm your choice by clicking again on the Unpublish button.
Deleting content
You can delete content by deleting any entry of a collection type, or the default entry of a single type.
- In the edit view of the entry, click on at the top right of the interface, and click the Delete document button.
If Internationalization is enabled for the content-type, you can also choose to delete only the currently selected locale by clicking on the Delete locale button. - In the window that pops up, click on the Confirm button to confirm the deletion.
You can delete entries from the list view of a collection type, by clicking on on the right side of the entry's record in the table, then choosing the Delete document button.
If Internationalization is enabled for the content-type, Delete document deletes all locales while Delete locale only deletes the currently listed locale.