wp_elementor_update_element
Updates one Elementor element after saving a private rollback snapshot. Prefer top-level fields for common edits: background_image_id/background_image_url plus background_size/background_position/background_repeat for containers; heading_html for heading widgets; text_editor_html for text-editor widgets; title_color and title_typography_font_family for heading styles. Use settings only for other Elementor settings and never call with settings: {}. If changing a child widget inside a selected container, update the child element_id directly. For Elementor HTML widgets, provide old_html and new_html to replace an exact fragment inside settings.html.
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>",
"post_id": "<post_id>",
"element_id": "<element_id>"
},
"name": "wp_elementor_update_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes | ||
| 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. | |
| new_html | No | Replacement HTML fragment for an Elementor HTML widget. Use an empty string to remove the exact fragment. | |
| old_html | No | Exact HTML fragment currently present in an Elementor HTML widget settings.html. | |
| settings | No | Elementor settings keys to merge for non-HTML-fragment updates. Must contain at least one setting; omit settings instead of passing {}. | |
| element_id | Yes | ||
| occurrence | No | 1-based occurrence to replace when old_html appears more than once. | |
| title_color | No | Replacement heading title color, for example #FFFFFF. | |
| heading_html | No | Replacement value for a heading widget settings.heading field, including any desired HTML wrapper. | |
| background_size | No | Elementor background_size, for example cover. | |
| text_editor_html | No | Replacement value for a text-editor widget settings.editor field. Use an empty string to clear it. | |
| background_repeat | No | Elementor background_repeat, for example no-repeat. | |
| background_image_id | No | Media attachment ID for an Elementor container background image. | |
| background_position | No | Elementor background_position, for example center center. | |
| background_image_url | No | URL for an Elementor container background image. | |
| title_typography_font_family | No | Replacement heading font family. |