wp_create_widget
Creates a text, custom_html, or block widget in a sidebar. Text widgets accept title/text strings and filter/visual booleans; custom_html accepts title/content strings; block requires a content string containing complete block markup. HTML follows WordPress permissions. Read back and verify the rendered page.
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": {
"site_id": "<site_id>",
"sidebar_id": "<sidebar_id>",
"widget_base": "<widget_base>",
"settings": "<settings>"
},
"name": "wp_create_widget"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site_id | Yes | The connected site's id returned by list_sites. Call list_sites first; do not use a URL or WordPress post ID. | |
| position | No | Optional 1-based insertion position. | |
| settings | Yes | JSON-encoded object of widget settings. | |
| sidebar_id | Yes | The sidebar/widget area ID. | |
| widget_base | Yes | The widget base ID: text, custom_html, or block. |