Write blocks
wp_write_blocksWrite block editor content to an existing post from a list of block specs. Types and fields: paragraph (content), heading (content, level 1-6), list (items, ordered), quote (content, citation), image (url, alt, caption), buttons (buttons: text, url), group (blocks), columns (columns: arrays of blocks), separator, spacer (height), code (content), html (content). mode is replace (default), append or prepend.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ID | Yes | Target post/page ID (create it first with wp_create_post). | |
| mode | No | replace (default) overwrites post_content; append/prepend add the blocks to the existing content. | |
| blocks | Yes | Ordered array of block specs. Each item is an object with a "type" and the fields for that type (see the tool description). |