Skip to main content

Content History

GrowthThis feature is available with a Growth plan. EnterpriseThis feature is available with an Enterprise plan. 5.0.0This feature requires Strapi version 5.0.0 or later.
Page summary:

Content History stores previous document versions so editors can compare and restore earlier states from the Content Manager. This documentation explains how to browse and restore workflows for quick rollback of mistakes. Versions are created for content edited in the Content Manager and through the Content API, and are kept for 14 days on the Growth plan and 30 days on the Enterprise plan.

The Content History feature, in the Content Manager, gives you the ability to browse and restore previous versions of documents.

IDENTITY CARD
Plan
CMS Growth or Enterprise plan
Role & permission
None
Activation
Available by default, if required plan
Environment
Available in both Development & Production environment
Content History
Read the steps as text
  1. Content History is accessible via this button, which lists several options for the entry.
  2. Click on Content History.
  3. This is the Content History interface! It shows the state of your content type at a chosen time.
  4. This is where you can see current and past versions of your content type. For each version, you can see:
    • the date and time,
    • the name of the user who edited the version,
    • and the status (if Draft & Publish is enabled).
  5. Let's click on a previous version!
  6. In this previous version, the category was "news" but it was later changed to "nature".
  7. If we want the content type to go back to that previous version, we can click on the Restore button.
  8. Restoring a previous version of the content type means overriding the "current" one, but as a draft that can be later published.

    Let's confirm by clicking on Restore again!
  9. And that's it! We've used Content History to restore a previous version ✨

A version is created when a document is modified through the Content Manager in the admin panel, or through a Content API write (REST or GraphQL). Content modified in any other way does not appear in the Content History of the document: this includes the Document Service API, lifecycle hooks, cron jobs, and the strapi import and strapi transfer commands.

Note
  • Content History is not a record of every change made to a document. Documents written outside a request, such as those created by a migration script, a lifecycle hook, or the strapi import and strapi transfer commands, have no corresponding version, and a document can therefore differ from the most recent version listed in its Content History. To trace the actions performed by users of the admin panel, use Audit Logs.
  • With Strapi 5.65.0 or later, versions are also created when a document is modified through the MCP server with an Admin token. These versions are attributed to the admin who owns the token, not to the token itself.

Configuration​

You can configure how long versions are kept before they are deleted, and whether Content History also records Content API writes.

Content History is not a permanent archive. Versions are deleted automatically: a job runs once a day, at midnight, and deletes every version older than the retention period, counted from the creation date of each version.

The retention period is defined by the license of your plan:

PlanDefault retention periodMaximum retention period
CMS Growth14 days14 days
CMS Enterprise30 days90 days

The retention period cannot be extended on the Growth plan. Contact the Strapi sales team to upgrade to the Enterprise plan, which offers 30 days by default and can be extended up to 90 days.

Note

Growth projects that were already using a 30-day retention period when the 14-day default was introduced keep it.

Caution

Versions deleted by the retention job cannot be recovered from the Content History interface.

Code-based configuration​

The retention period can be shortened, but never extended, with the history.retentionDays parameter of the /config/admin file. When both the license and the configuration file define a value, the lower of the 2 applies.

Content History records Content API writes (REST and GraphQL) by default. Set history.contentApi.enabled to false to stop recording them. This flag does not affect writes made through the Content Manager.

/config/admin.js
module.exports = ({ env }) => ({
// … other configuration properties
history: {
retentionDays: 7,
contentApi: {
enabled: false,
},
},
});

There is no equivalent setting in the admin panel: the retention period and the Content API recording flag can only be set from the /config/admin file.

Usage​

Path to use the feature: Content Manager
From the edit view of a content type: click (top right corner) then Content History.

Browsing Content History​

With Content History, you can browse your content through:

  • The main view on the left, which lists the fields and their content for the version selected in the sidebar on the right.
  • The sidebar on the right, which lists the total number of versions available, and for each version:
    • the date and time when the version was created,
    • its author,
    • a tag for the source of the write: Admin panel, Admin API, Content API, or MCP,
    • and whether its status is Draft, Modified, or Published (see Draft & Publish for more information about document statuses).
Browsing versions in Content HistoryBrowsing versions in Content History
Note

The main view of Content History clearly states whether a field was inexistent, deleted, or renamed in other versions of the content-type. Fields that are unknown for the selected version will be displayed under an Unknown fields heading below the other fields.

Version source and author​

Each version records its source and author:

SourceMeaning
admin-panelThe version was created by a user logged into the admin panel
admin-apiThe version was created using an Admin API token on the Content Manager routes
content-apiThe version was created through a Content API route (REST or GraphQL)
mcpThe version was created using an Admin API token on the MCP server

The author is tracked separately from the source. Each version stores the type of author (person or token) and an identifier:

  • Person: An admin panel user, or, for a Content API write, the end user logged in with the Users & Permissions plugin. A write made with an Admin API token, on the Content Manager routes or on the MCP server, is attributed to the admin who owns the token. The version shows the user's current name. If the user is deleted, the version shows "Deleted user".
  • Token: An API token used for a Content API write. The version shows the token's current name. If the token is deleted, the version shows "Deleted token".

A Content API write has no author when the request is not authenticated, for example a write allowed for the Public role. The version then shows no author.

An author reference persists after deletion. If a user or token is recreated later with the same identifier, it does not reuse the reference.

Versions created before source and author tracking was added show the source as admin-panel and their author is the admin panel user from the createdBy field.

Restoring a previous version​

You can choose to restore a previous version of a document. When restoring a version, the content of this version will override the content of the current draft version. The document switches to the Modified status and you will then be able to publish the content whenever you want (see Publishing a draft).

  1. Browse the Content History and select a version via the sidebar on the right.
  2. Click the Restore button.
  3. In the Confirmation window, click Restore.
Note

If the Internationalization (i18n) feature is enabled for the content-type, restoring a version with a unique field (i.e. a field whose content is the same for all locales) will restore the content of this field for all locales.

Was this page helpful?