Undo a change
wp_undoReverse one earlier change using its undo token (from the "undo" field of the original result, or from wp_undo_list). dry_run=true shows exactly what would be restored and what refused, without changing anything; wp_undo_discard drops a point without restoring it. Undoing needs the same permission as the original action, and each item is re-checked against the CURRENT state, so an option that has since been protected or a post this account may no longer edit is reported as blocked rather than restored. An undo of a page-builder change (wp_update_builder_element) or of a plugin's ability (wp_run_ability) puts every stored copy of the page back byte for byte and refuses a page that someone has changed since — restoring would throw that newer work away — unless force=true. A fully successful undo consumes the token; a partial one keeps it, so a later call can retry the rest. Afterwards the page caches of the supported caching plugins are asked to purge the restored posts, and after any other undo (options, settings, theme, files, PHP snippets) every page of this site; page_cache_purged lists them, page_cache_skipped names a cache left out on a multisite network and why. A PHP file of an active plugin or theme that is written back is followed by the same test requests as wp_write_plugin_file runs, and so is a PHP snippet of Code Snippets or WPCode that is written back switched on; probe lists their result per file or snippet. Where the site answered those requests before the undo and does worse after it (a fatal error it did not have, no answer, this MCP endpoint cut), the state before the undo is put back in the same call: the item is listed under failed with the reason, and the token is not consumed, so the undo point stays. Where nothing could be compared, the result is only reported. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Page-builder undo points only: true restores a page even where it was changed after the change being undone, which throws that later change away. Default false: such a page is reported as blocked (changed_since). | |
| token | Yes | The undo token, e.g. undo_1a2b..., from the undo field of the original result or from wp_undo_list. | |
| dry_run | No | true returns what the undo would restore and changes nothing. Default false. |