Delete Widget


Permanently deletes a widget and its settings. This cannot be undone, so it needs confirm set to true. To take a widget off the site but keep it, use mosmcp/widget-move with area "wp_inactive_widgets" instead, which is reversible. The answer includes the deleted widget's settings or block markup, so it could be recreated with mosmcp/widget-add.

Also known as: delete widget, remove widget permanently, delete sidebar widget, delete footer widget.

Property Value
Ability slug mosmcp/widget-delete
Wire tool name mosmcp__widget-delete
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: true · idempotent: true · openWorld: false

 

Input schema

Field Type Required Default Description
widget_id string Yes — The widget ID to delete, such as "text-2", as mosmcp/widget-list reports it.
confirm boolean false Must be true. The widget and its settings are gone for good; moving it to "wp_inactive_widgets" with mosmcp/widget-move is the reversible alternative.

 

Output schema

Field Type Required Description
widget_id string Yes
deleted boolean Yes
previous_area string Yes
previous_position integer Yes
widget object
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.
warnings object[] Non-fatal issues encountered while running.
warnings[].code string
warnings[].message string
warnings[].context string
notes string[]

 


<< Previous Next >>
Add Widget Get Widget

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.