Editorial workflow diagram showing how WordPress revisions store post content changes, compare diffs, and pair with full database backups for complete recovery

Editorial illustration: what WordPress Revisions track in the database and how to combine revision caps with full site backups.

A client once called me in a mild panic because their entire pricing table had vanished from a high-traffic landing page. Someone on the marketing team had opened the page to fix a typo, accidentally selected a Gutenberg block group, hit backspace, and clicked Update. Five minutes later they noticed, tried to fix it from memory, and saved twice more.

That is the exact scenario WordPress revisions were built for—and also where people make it worse by panicking or by having disabled revisions months earlier to “speed up the database.”

What revisions actually store in wp_posts

Every time you save a draft or update a published post or page, WordPress writes a snapshot row into the wp_posts table with post_type = 'revision' and post_parent pointing back to the original post ID. It tracks the post title, content (post_content), and excerpt.

What it does not track by default is just as important:

  • Uploaded media files: If you delete an image from the Media Library, restoring an older revision brings back the <img> tag or block markup, not the deleted file on disk.
  • Custom fields and plugin tables: Standard post revisions do not automatically version arbitrary wp_postmeta rows or custom WooCommerce/plugin tables unless a plugin explicitly hooks into revision metadata.
  • Theme files, menus, and site options: Revisions live at the post level. A broken header template or a bad plugin update cannot be rolled back from the post editor.

That distinction matters. Revisions are an editorial undo history for individual posts and pages, not a replacement for database and file backups.

Recovering a bad edit without burying the good version

When someone notices a broken page, the worst reflex is to keep hitting Update while trying to reconstruct the missing text. Every save adds another revision row and pushes the clean version further down the slider.

The cleaner recovery sequence takes two minutes:

  1. Stop saving. Copy any newly written paragraphs into a local scratchpad so nothing new is lost, then leave the editor alone.
  2. Open Revisions in the Document sidebar. In the Block Editor, click the Revisions link under the post status panel. You will get a two-handle comparison slider showing a line-by-line diff.
  3. Read the diff, not just the timestamp. Scroll through the highlighted red and green blocks until you find the last snapshot with the intact structure. Check links, shortcodes, and embedded blocks before clicking Restore This Revision.
  4. Preview before publishing. Restoring loads the old snapshot into the editor; review it in Preview—especially if plugins or shortcodes changed since that revision was saved—before committing the update.

If a page uses a page builder or heavy custom fields, check the rendered frontend immediately after restoring. Sometimes the text comes back cleanly while a layout setting stored in post meta still needs manual adjustment.

Autosaves are session protection, not history

Autosaves often get lumped together with revisions, but they behave differently. By default, WordPress triggers an autosave every 60 seconds (controlled by AUTOSAVE_INTERVAL in wp-config.php) and stores at most one autosave per user per post.

Crucially, an autosave does not overwrite the live published post. If your browser crashes or your Wi-Fi drops mid-sentence on Unifi, WordPress detects the newer autosave when you reopen the editor and offers a banner to restore it. Once you hit Update, you are back to normal revisions.

Because there is only one autosave slot per user, it only protects the current editing session. It will not save you from a bad deployment, a compromised admin account, or a corrupted database table.

Capping revisions without crippling your editors

On active sites where editors tweak long-form posts twenty times before publishing, unlimited revisions can bloat wp_posts. I have seen small Malaysian SME blogs with 300 published posts carrying 12,000+ revision rows in the database.

Instead of disabling revisions completely with define( 'WP_POST_REVISIONS', false );, cap them to a sensible number in wp-config.php:

// Keep the last 10 revisions per post and bump autosave interval to 2 minutes
define( 'WP_POST_REVISIONS', 10 );
define( 'AUTOSAVE_INTERVAL', 120 );

If you need tighter control—say, 15 revisions for long landing pages but only 3 for a custom post type like product or event—use the wp_revisions_to_keep filter in a small must-use plugin rather than installing a bloated cleanup plugin:

add_filter( 'wp_revisions_to_keep', function ( $num, $post ) {
    if ( 'page' === $post->post_type ) {
        return 15;
    }
    return 5;
}, 10, 2 );

Note that setting WP_POST_REVISIONS only limits future revisions; it does not delete existing ones. If you want to see how much space old revisions are actually taking before touching anything, check via WP-CLI or SQL first:

wp db query "SELECT COUNT(*) AS revision_rows FROM wp_posts WHERE post_type = 'revision';"

And before you run any bulk cleanup, take a real database dump so you have an exit hatch:

wp db export pre-cleanup-$(date +%F).sql

Pairing revisions with a real backup habit

Revisions shine for human mistakes inside the editor. They fail the moment an error crosses into wp_options, plugin updates, or deleted media.

For client sites I maintain, I keep WP_POST_REVISIONS between 10 and 15, disable third-party “database optimizer” plugins that silently wipe revisions on a cron schedule, and rely on automated off-site database and wp-content backups tested periodically on staging. Each tool gets one job: revisions handle fast editorial recovery, staging catches layout regressions, and backups handle everything else.

For related guides that complement this checklist, see:

Sources