ZeroToWP

Revision

Quick Definition

A revision is a saved version of a WordPress post or page. Every time you click Save or Update, WordPress stores a copy so you can compare changes or restore a previous version.

WordPress Revisions documentation on wordpress.org

What Is a Revision?

A revision is a snapshot of your post or page content at a specific point in time. Every time you hit Save Draft, Update, or Publish in the WordPress editor, WordPress stores a copy of the content in the database. These copies accumulate as a version history — like Git for your content — letting you see what changed, when, and by whom.

WordPress tracks changes to four fields: title, author, content, and excerpt. The revision interface shows a visual diff — added text is highlighted in green, removed text in red — so you can instantly see what was modified between any two versions.

There are two types of revisions:

  • Manual revisions — Created every time you click Save/Update. WordPress stores one for each save, with no limit by default.
  • Autosaves — Created automatically every 60 seconds while you are editing. Only one autosave per user per post exists at a time (new ones overwrite old ones). If your browser crashes, WordPress shows a notice asking if you want to restore the autosave.

To browse revisions, open any post in the editor and click the Revisions link (or the clock icon in the sidebar). A slider lets you move between versions chronologically, and a "Compare any two revisions" checkbox lets you diff any two versions side by side. Click Restore This Revision to revert to a previous version.

Revisions are stored in the wp_posts table as children of the parent post, with a post type of revision. On busy sites with many authors, this can add thousands of rows to the database — which is why limiting revisions is a common database optimization step.

Revisions in Practice

You can limit how many revisions WordPress keeps by adding a constant to wp-config.php:

define( 'WP_POST_REVISIONS', 5 );

This keeps the 5 most recent revisions per post and automatically deletes older ones. Other options:

  • true or -1 (default) — Store every revision
  • false or 0 — Disable revisions (autosaves still work)
  • Any positive number — Keep that many revisions per post

For existing sites with thousands of accumulated revisions, plugins like WP-Optimize or WP-Sweep can bulk-delete old revisions to shrink your database. With WP-CLI, you can run wp post delete $(wp post list --post_type=revision --format=ids) to clean up from the command line.

In WordPress 7.0, the revision system gets a major upgrade: Visual Revisions — a side-by-side visual comparison of how the page looked at different points, not just a text diff. This makes it much easier to spot layout and design changes.

Why It Matters

Revisions are your undo button. They protect you from accidental deletions, bad edits, and content mistakes — especially on sites with multiple authors. Understanding how to browse, restore, and limit revisions keeps your content safe and your database lean.

Sources

Related Terms

Related Articles