Content revisions
Drupal allows you to create a new revision each time content is updated. This enables you to track how content has changed over time on your site.
While this feature is now enabled by default, you can change the revision behavior for each content type by going to Administration > Structure > Content Types > Operations > Edit > Publishing Options and checking the “Create new revision” box. This ensures a new revision is created when a node is edited. (Editors can override this setting when editing individual nodes.)
To view and manage revisions, use the “Revisions” tab when viewing a node (requires the “View revisions” or “Administer content” permission). On the Revisions tab, you can view individual revisions, revert to earlier ones, and delete revisions (requires the “Administer content” or both “Revert revisions” and “Delete revisions” permissions).
An interesting detail about the revision system is how the revert mechanism works. Suppose you have revisions {1, 2, 3, current}. If you revert to revision #2, a copy of #2 will be created and set as the current revision. So after reverting, you'll have {1, 2, 3, 4, current}, where current is a clone of #2, and #4 is the previously current revision.
Another useful feature is the revision log message field, which appears next to the “Create new revision” checkbox in the node edit form. If you enter a message in this field when creating a revision, the message will appear in the Revisions tab alongside that revision. It’s recommended to include a meaningful message whenever you create a node revision so that others (or you, months later) can understand why the node was changed and what was changed—without having to inspect the actual content of previous revisions. Although this field is optional as of this writing, there is a feature request to make it configurable as a required field.
The Revisions tab lists all revisions in a table that includes the timestamp, the user who made the change, and the revision log message if one was provided.
You can enhance the Revisions tab by installing the Diff module. This module lets you see differences between two revisions. Without it, you can only view the full content of each revision, which can make it hard to pinpoint changes.
Note that the node_revision table in the database will always contain one entry for each record in the node table, tracking the current revision—even if revisions are disabled. If revisions are enabled, multiple entries will appear in node_revision for each node, representing both the current and all past revisions.
For additional functionality, including making changes mandatory when editing content, see the Content Moderation documentation.
Originally based on https://www.drupal.org/node/320614 and updated for Drupal 8.
Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.