wp_blocks_replace
Replace a Gutenberg block with zero or more blocks in WordPress, using hash references to avoid overwriting stale content and supporting dry-run preview.
Instructions
Replace one Gutenberg block with zero or more blocks. Hash references prevent overwriting a block changed since it was read. Supports dry-run.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ref": "<ref>",
"at": "<at>",
"blocks": "<blocks>"
},
"name": "wp_blocks_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | Yes | ||
| ref | Yes | Post or page ID/slug | |
| blocks | Yes | ||
| dry_run | No | Preview changes without writing | |
| post_type | No | page | |
| allow_normalization | No | Allow saving when parse/serialize normalizes the original content | |
| if_unmodified_since | No | Fail if modified_gmt changed since this timestamp |