Change a post or page
wp_update_postUpdate an existing post, page or entry of any post type; only the fields passed change. Returns {updated: true, post} with the entry's summary (the fields of wp_list_posts), plus builder_note where the new content shows but the page builder may replace it later. Needs the right to edit the entry; moving it to publish, private or future needs the right to publish. Changes to a published entry show on the site at once; a status change can publish an entry or take it off the site, and giving a trashed entry a status takes it out of the trash. For a revision id, WordPress stores custom fields (meta) on the post the revision belongs to. On a page whose page builder shows its own data, post_content is only a copy: a call with content is refused there before anything is written, with the way to make the change; a call without content still changes the other fields. wp_get_builder_layout returns the outline of such pages. An undo point keeps the previous values of the fields the call changes (title, content, excerpt, status, slug, parent, author, date; with the status also the date, since publishing an undated draft dates it), read just before the write; meta and terms are not part of it. The answer adds undo, the token for wp_undo (null when no snapshot could be taken). Page-builder data in "meta" (keys such as panels_data or dslc_code) takes the unfiltered_html capability, which on a multisite network only a super admin has; the keys are those of the core's list (filter ab_mcp_builder_markup_meta_keys) and of Pro's own (filter ab_mcp_pro_markup_meta_keys), and without the capability the call is refused before anything is written. Forwarded by AlphaBridge Connect to the one site this connection reaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Post id. | |
| date | No | New publish date. Site time as "Y-m-d H:i:s" (or "Y-m-d H:i", "Y-m-d"), or RFC 3339 with an offset, the form of the dates this plugin returns, e.g. "2026-10-02T09:00:00+02:00". Times that do not exist in the site's timezone (clocks skip them) are refused, as is a time where the clocks go back that WordPress would read as the other of the two. A date alone never changes the status: a save that would publish the post or take it off the site is refused unless that status is passed as well, and a post is scheduled only for a date at least five minutes ahead. | |
| meta | No | Key/value custom fields to set. Keys are stored as sanitize_key() writes them (lower case; letters, digits, _ and -). Keys starting with "_", protected or credential-like keys and keys the account may not edit are skipped without an error. Page-builder data (keys such as panels_data, dslc_code or pagelayer-data; filter ab_mcp_builder_markup_meta_keys) takes the unfiltered_html capability, which on a multisite network only a super admin has; without it the call is refused before anything is written. | |
| slug | No | New URL slug; it changes the permalink where the permalink structure uses slugs. When omitted, it stays as it is. | |
| terms | No | Taxonomy => array of term ids or names, e.g. {"post_tag":["News"]}. Replaces the post's terms in each taxonomy given; other taxonomies keep theirs. A name that does not exist yet is created where the account may manage the taxonomy's terms, else left out; unknown taxonomies and taxonomies the account may not assign are skipped without an error. | |
| title | No | New title. When omitted, it stays as it is. | |
| author | No | New author user id. Applied only for an account that may edit others' entries of this type; otherwise left as it is. | |
| parent | No | New parent post id; 0 for none. When omitted, it stays as it is. | |
| status | No | draft, publish, pending, private, future. "future" needs a date at least five minutes ahead. When omitted, the status stays; on a trashed entry any of these takes it out of the trash. | |
| content | No | New content (HTML or block markup); it replaces the whole post_content. When omitted, it stays as it is. | |
| excerpt | No | New excerpt. When omitted, it stays as it is. |