Update content
update_contentUpdate WordPress content by ID with full-content replacement or targeted find/replace edits. For small changes, use edits to avoid altering the rest of the document.
Instructions
Update any content type by ID. Supply content to replace the body wholesale, or edits for targeted find/replace changes that leave the rest of the document untouched — the latter is safer on long pages and is what you should reach for when changing a heading, a price, or one paragraph. An edit that matches nothing fails loudly rather than silently writing nothing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The content ID to update. | |
| date | No | Publish date in site time, ISO 8601 (2026-01-31T09:00:00). With status "future" (or "publish" and a future date) this schedules the post. | |
| meta | No | Custom fields, as key/value pairs. A key only writes if it is registered with show_in_rest — use set_content_meta for unregistered keys. | |
| slug | No | URL slug. Changing this on published content breaks existing links unless you add a redirect. | |
| type | No | Content type of that ID. | post |
| edits | No | Targeted find/replace edits applied to the existing raw content, so you can change one paragraph without resending the whole document. Edits apply in order. Mutually exclusive with `content`. | |
| terms | No | Taxonomy assignments keyed by taxonomy slug or REST base, e.g. {"categories": [3], "tags": ["news"]}. Replaces the item's terms in each taxonomy given. Names that do not exist yet are created. | |
| title | No | The title, as plain text. | |
| author | No | User ID of the author. | |
| format | No | Post format. Only applies to types that support post formats. | |
| parent | No | Parent ID, for hierarchical types such as pages. 0 for none. | |
| status | No | publish | future | draft | pending | private | trash. "future" needs a `date` in the future. "trash" moves the item to the trash (same as delete_content without force). | |
| sticky | No | Pin the post to the top of the blog. Posts only. | |
| content | No | Full content body, replacing whatever is there. For the block editor this is block markup (<!-- wp:paragraph --><p>…</p><!-- /wp:paragraph -->); classic content is plain HTML. Use `edits` instead for a small change. | |
| excerpt | No | Hand-written excerpt. | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. | |
| password | No | Password-protect the content. Empty string removes the password. | |
| template | No | Page template file, e.g. "templates/full-width.php". Empty string for the default template. | |
| menu_order | No | Sort order for hierarchical types. | |
| ping_status | No | Whether pingbacks and trackbacks are accepted. | |
| comment_status | No | Whether comments are open on this item. | |
| featured_media | No | Attachment ID of the featured image, or 0 to remove it. Upload it with create_media first. |