Update Widget
Changes a widget's settings or, for a block widget, its block markup. Settings are merged into the ones it has, so anything not mentioned keeps its value; set replace to true to reset everything not mentioned to the widget's defaults instead. Saved through the widget's own validation, exactly as on the Widgets screen, and read back: the answer lists which settings changed and anything WordPress adjusted on the way in. A masked secret sent back unchanged keeps the stored value. Does not move the widget; use mosmcp/widget-move for that. Read the widget with mosmcp/widget-get first.
Also known as: edit widget, change widget text, change widget title, update sidebar widget, edit custom html widget, edit footer widget.
| Property | Value |
|---|---|
| Ability slug | mosmcp/widget-update |
| Wire tool name | mosmcp__widget-update |
| Category | Widgets & Sidebars (mosmcp-widgets) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_theme_options |
| Minimum default role | Administrator (Shop manager too when WooCommerce is active) |
| Annotations | readOnly: false · destructive: false · idempotent: true · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| widget_id | string | Yes | — | The widget ID, such as "text-2" or "block-3", as mosmcp/widget-list reports it. |
| settings | object | — | Settings to change, by name, for example {"title": "Contact us"}. Merged into the existing settings unless replace is true. Not used for block widgets, which take block_markup. | |
| block_markup | string | — | The complete new block markup, for a block widget only. It replaces the widget's markup. HTML is saved the way the WordPress editor saves it: a user with the unfiltered_html capability can save any markup, including forms, scripts and styles, and markup a user is not allowed to save is refused with the reason rather than silently removed. Backslashes are kept. | |
| replace | boolean | false |
When true, settings not mentioned go back to the widget's defaults instead of keeping their values. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| widget_id | string | Yes | |
| area | string | Yes | Area the widget is in now. |
| position | integer | Yes | 0-based position in that area now. |
| widget | object | Yes | |
| widget.widget_id | string | Yes | The widget ID, for example "block-3" or "text-2". |
| widget.id_base | string | Yes | The widget type, for example "block", "text" or "custom_html". |
| widget.type_name | string | ||
| widget.area | string | Area ID the widget is in. | |
| widget.area_name | string | ||
| widget.area_status | string (one of active, inactive, unregistered) |
"active" when the area is shown on the site, "inactive" for the inactive-widgets bin, "unregistered" for an area the active theme does not register. | |
| widget.position | integer | 0-based position in its area; 0 is the top. | |
| widget.title | string | ||
| widget.summary | string | One line describing what the widget shows. Secrets are never included. | |
| widget.is_block_widget | boolean | ||
| widget.blocks | string[] | Block types in a block widget. | |
| widget.settings_editable | boolean | False when the widget's type is missing or not built with the standard widget API; it can still be moved or deleted. | |
| widget.settings | object | All the widget's settings, with secret-looking values masked. For a block widget, its content setting holds the block markup. | |
| widget.masked_settings | string[] | Names of settings whose values are masked. | |
| widget.block_markup | string | The block markup of a block widget. Empty for other widgets. | |
| area_widgets | string[] | Every widget in that area, in display order. | |
| warnings | object[] | Yes | Non-fatal issues encountered while running. |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string | ||
| notes | string[] | ||
| changed | boolean | Yes | False when the widget already had these settings. |
| changed_settings | string[] | Names of the settings whose stored values changed. |
| << Previous | Next >> |
|---|---|
| Move Widget | Create Preview Link |
For more information about the Secure MCP Server for WordPress plugin, explore the following resources:
Product Overview | Pricing | Try for Free | Documentation
If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.