How to undo a WordPress page push with Rollback and Snapshot History
You pushed a page to production. Something about it was wrong — stale content, a field that shouldn't have been overwritten, a version you didn't mean to send yet. Now the live page is wrong and you need the old one back, right now, not after you find last night's full-site backup and restore it (taking every other change made since then back with it). What you actually want is much smaller than that: undo the one thing this one push changed.
What "rollback" actually undoes
A full-site backup restore is a blunt instrument — it reverts everything to a point in time, including unrelated changes nobody wanted reverted. A deployment rollback is scoped to exactly what a single push could have changed on the one post it touched: before anything is written — before the post's fields, meta, or taxonomies get overwritten — the destination's current state is captured first. If the push never actually gets that far (a conflict, a validation failure), there's nothing to roll back because nothing changed yet. If it succeeds, there's now a snapshot of "what this post looked like one second before this push landed," sitting there in case you need it.
There are two different starting situations rollback has to handle correctly. If the push created a brand-new post on the destination, there's no "before" state to restore — the honest undo is deleting that post and forgetting it was ever created, the same cleanup that already runs if a fresh push fails partway through. If the push overwrote a post that already existed, the captured snapshot is what comes back: title, content, excerpt, status, slug, dates, menu order, the post's own meta, its taxonomy terms, its featured image.
Not just "undo the last one" — a real history
Every push that overwrites a post adds its own snapshot, so a page that's been pushed to many times over weeks or months builds up a real history, not just a single "previous version" slot. Rollback's default is undoing the last deployment, but that's a convenience default, not the only option — any snapshot in a post's history can be restored directly, for when the version you actually want back is three pushes ago, not one. Left completely unbounded, that history would quietly turn into an unmanaged full-content backup system; snapshots older than a configured retention window get pruned automatically, which only removes how far back you can roll — it never touches the posts themselves or the plugin's own deployment history.
What a restore has to be careful not to touch
A snapshot's meta capture — and its restore — both stop at the same boundary: ordinary content meta, not the plugin's own bookkeeping, not WPML's internal translation-linking state, not secrets, not WordPress's own internal edit-lock values. A rollback should only ever undo what a deployment itself could have changed, never reach past that into state the push never touched in the first place.
Restoring meta also has to handle keys that didn't exist before the push at all. If a deployment added a new meta key that wasn't there previously, a correct rollback removes that key entirely, not just reverts its value to something — otherwise "restored" content quietly keeps a field the pre-push version never had, which isn't actually the old state at all, just a version that looks close to it.
The part that's easy to get wrong
A snapshot captures a post's meta exactly as it existed at that moment — including a value that was already malformed before the snapshot was ever taken. That turned out to matter in a very specific way: an Elementor page's design settings can end up stored as an empty string instead of a proper empty array (a shape Elementor's own editor itself produces under certain conditions, not something PostDeploy caused). A normal push already has a repair step that fixes exactly this malformed shape on the way in. A snapshot restore, writing the captured meta back verbatim, doesn't go through that same import path — so without extra care, restoring an old snapshot could resurrect that same bad value and reproduce the identical fatal error the moment the page was opened again, even though the rest of the restore worked perfectly.
The fix wasn't to teach the rollback code about Elementor directly — that would mean a plugin with no Elementor integration at all (the free tier) carrying Elementor-specific logic it has no use for. Instead, restoring a snapshot fires its own extension point immediately after writing the data back, the same seam a normal import already uses for this exact repair, so Elementor's own integration can fix the shape right after a restore the same way it already does after an ordinary push — without the rollback logic itself needing to know Elementor exists.
What PostDeploy does about all of this
Every push that overwrites an existing post automatically captures a snapshot first, scoped to exactly what a deployment could change and nothing more. Rollback undoes the most recent deployment with one action — correctly handling both "this created a new post" (delete it) and "this overwrote an existing one" (restore the snapshot) — while Snapshot History lets you reach further back and restore any specific earlier version of a post, not just the last one. Snapshots older than your configured retention window are pruned automatically rather than accumulating forever, and every rollback or restore attempt, success or failure, is recorded in the audit log. It's available from the Dashboard, from wp postdeploy rollback and wp postdeploy pull's WP-CLI siblings, and from the REST automation API covered in the previous post.
Try it
PostDeploy Free moves Posts, Pages, and custom post types as plain content. PostDeploy Pro adds the automatic snapshots, Rollback, and Snapshot History described here, alongside ACF, Elementor, and WPML reference resolution.