royal-mcp__wp_update_widget
Update a widget instance by ID. Requires the "Allow AI to modify theme appearance" admin toggle AND edit_theme_options capability. Uses WordPress core /wp/v2/widgets so classic and block widgets are handled uniformly. Pass the id returned by wp_get_widgets. Response includes a 7-day undo token that restores the prior widget instance via mcp_undo_last_operation. Backslashes (JSON unicode escapes, embedded JSON-LD, Divi loop field bindings) are stored as sent. (site: demo.royalplugins.com) Through Royally: waits for a person to approve it in Royally; nothing on the site changes until then.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Widget ID (e.g. text-2, block-15) | |
| sidebar | No | Sidebar ID to place the widget in (omit to leave unchanged) | |
| site_id | No | Site to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com) | |
| instance | No | Widget instance data. For classic widgets, pass the settings as {raw: {…}} as wp_get_widgets returns them; Royal MCP encodes them for widgets that only take the encoded form. | |
| form_data | No | Serialized form data (classic widgets alternative to instance) |