Update content
update_contentUpdate WordPress content by ID via full-body replacement or targeted find/replace edits that fail loudly on no match, keeping long pages intact.
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" 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 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 REST base, e.g. {"categories": [3], "tags": ["news"]}. 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: standard, aside, gallery, link, image, quote, status, video, audio, chat. | |
| parent | No | Parent ID, for hierarchical types such as pages. | |
| status | No | publish | future | draft | pending | private | trash. | |
| 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. | |
| template | No | Page template file, e.g. "templates/full-width.php". | |
| 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. Upload it with create_media first. |