Post Toolswordpress_update_post

wordpress_update_post

Update a WordPress post using Respira's duplicate-first safety workflow.

wordpress_update_post

Update a post. Respira automatically creates a duplicate for safety.

Parameters

19 parameters, 1 required.

NameTypeRequiredWhat it is
idnumberyesPost ID
expected_versionstringnoOptional. The content_version from your last read or write of this page. The write is refused with respira_version_conflict (409, nothing written) if the page changed since, e.g. another agent or an editor saved it. Read again, reapply your change, and retry with the new content_version.
titlestringnoNew post title
contentstringnoNew post content (HTML)
statusstringnoPost status (publish, draft, pending)
slugstringnoURL slug (post_name). Example: "my-post" produces /my-post/.
excerptstringnoPost excerpt (wp_posts.post_excerpt) — the "Excerpt"/"Zajawka" panel, RSS summaries and archive teasers. Do NOT pass this inside meta: an excerpt written as post meta reads back fine and renders nowhere.
authoranynoAuthor (user id or user login). Requires edit_others_posts capability when different from the acting user.
categoriesarray of valuesnoShorthand for the built-in "category" taxonomy. Accepts term ids (number) or slugs/names (string). Replaces existing categories unless append_terms=true.
tagsarray of valuesnoShorthand for the built-in "post_tag" taxonomy. Accepts term ids (number) or slugs/names (string).
taxonomiesobjectnoGeneric map of taxonomy slug to array of term ids/slugs for custom taxonomies (e.g. product_cat). Example: { "product_cat": [12, "featured"] }.
featured_medianumbernoAttachment ID to set as the featured image. Pass 0 to clear.
create_missing_termsbooleannoWhen true, auto-create taxonomy terms that do not exist by name. Default false (strict: unknown slug returns 400).
append_termsbooleannoWhen true, append to existing taxonomy terms instead of replacing. Default false (replace).
custom_cssstringnoCustom CSS for the post. Auto-detects builder: Divi → _et_pb_custom_css, Elementor → _elementor_page_settings.custom_css.
metaobjectnoPost meta data
edit_targetstringnoChoose ask, live, or duplicate when the target is an original post. One of: ask, live, duplicate.
forcebooleannoBackward-compatible alias for explicit live editing when direct editing is enabled.
skip_security_checkbooleannoAdvanced: bypass Respira content security checks and sanitization for this update. Use only with trusted content.

Example call

The smallest valid call, with the required parameters only:

{
  "name": "wordpress_update_post",
  "arguments": {
    "id": 123
  }
}

Response

{
  "id": 202,
  "status": "draft",
  "duplicate_created": true,
  "duplicate_id": 202,
  "original_id": 101,
  "approval_url": "https://yoursite.com/wp-admin/admin.php?page=respira-approvals"
}

What it changes

It removes or overwrites something on the site, so treat it as the careful kind of call. Respira takes a snapshot before the write, and the change can be undone from that snapshot for 90 days. On a page or post the edit lands on a copy first. The live page changes only when a person approves the copy in wp-admin. Calling it twice with the same arguments leaves the site in the same state as calling it once. On a connection set to read-only it is refused with respira_scope_denied.

When it fails

The failures seen most often on real sites in the last 30 days, most common first:

  • respira_duplicate_exists: A copy of this page is already waiting for review. Edit that copy (its ID is in the error), or approve or reject it first.
  • respira_security_validation_failed: The content contains a pattern the security check blocks, such as a script tag or an inline event handler. Remove it. If it is meant to be there, the error names the pattern and how to allow it.
  • respira_direct_edit_disabled: The site only allows edits on a copy, never on the original page. Create a duplicate with wordpress_create_page_duplicate and edit that. A person approves it in wp-admin.
  • respira_post_not_found: No post or page has that ID. List the pages or posts and take the ID from the result.

How long it takes

A typical call takes about 3.2 seconds. 19 in 20 finish within 5.5 seconds. Measured on real sites over the last week, so it includes the site's own hosting.

Availability

Works on any WordPress site, whichever page builder it uses. Available since Respira 1.0.0.

Notes

  • Always creates a duplicate unless force: true and direct editing is enabled

Example Prompts

  • "Update my latest blog post title"
  • "Set post 101 to draft"
  • "Update post 101 content with the new announcement"