Custom Post Type Toolswordpress_update_custom_post

wordpress_update_custom_post

Update a custom post by type and ID. Supports meta fields and builder custom CSS.

wordpress_update_custom_post

Update a custom post. Supports meta fields and custom CSS for Divi/Elementor builders.

Parameters

18 parameters, 2 required.

NameTypeRequiredWhat it is
typestringyesPost type name
idnumberyesPost ID
titlestringnoPost title
contentstringnoPost content
statusstringnoPost status
slugstringnoURL slug (post_name).
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).
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.
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).
append_termsbooleannoWhen true, append to existing taxonomy terms instead of replacing. Default false (replace).
post_parentnumbernoParent post ID. Pass 0 to detach. Accepts parent, parent_id, or post_parent.
metaobjectnoPost meta data (e.g., { "_et_pb_custom_css": "/* CSS */" })
custom_cssstringnoCustom CSS for page builders (Divi/Elementor). Automatically saved to the appropriate meta field based on detected builder.
edit_targetstringnoChoose ask, live, or duplicate when the target is an original item. One of: ask, live, duplicate.

Example call

The smallest valid call, with the required parameters only:

{
  "name": "wordpress_update_custom_post",
  "arguments": {
    "type": "value",
    "id": 123
  }
}

Response

{
  "success": true,
  "type": "product",
  "id": 3001,
  "updated": true
}

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_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_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_post_not_found: No post or page has that ID. List the pages or posts and take the ID from the result.
  • 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.

How long it takes

A typical call takes about 2.1 seconds. 19 in 20 finish within 3.8 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

  • If you pass customCss, Respira will store it in the correct builder meta field when possible
  • Use meta for advanced builder/meta workflows

Example Prompts

  • "Update product 3001 title to 'Pro Plan'"
  • "Update portfolio item 42 content"
  • "Set custom CSS on product 3001"