30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Update Elementor Element

elementor/update-element replaces the element at a given ID with a new element payload.

It is guarded by force_replace because replacement takes the children with it.

Before you run it

This replaces the element and every child it has. A container with twenty widgets inside it, replaced with an empty container, loses all twenty — and the payload that does it looks perfectly reasonable. force_replace is the guard, and elementor/merge-element-settings is what you almost always want instead.

At a glance

Abilityelementor/update-element
ToolsetElementor — toolset/elementor
GroupElementor › Elements & Widgets
RequiresElementor, active on the site
Capabilitymanage_options
SafetyDestructive — replaces an element and everything inside it. Guarded by force_replace rather than a confirmation flag.
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

Replacement is occasionally the right operation — changing a widget’s type, rebuilding a subtree from a known-good structure, applying a payload produced elsewhere.

Far more often the intent is to change a setting, and replacement is a very expensive way to do that. elementor/merge-element-settings exists for the common case.

The guard fires when the replacement would remove content: a populated element being replaced by something smaller. That is the shape of the accident, and requiring an explicit flag makes it deliberate.

The element ID is preserved through the replacement, so anything referencing it — a link anchor, a CSS selector in custom code — keeps working.

Not idempotent in general, since the payload may contain child elements whose IDs are regenerated.

Elementor generates a CSS file per post and caches it. A change to the document does not change the rendered page until that CSS is regenerated, which is why elementor/clear-cache is the second half of several operations here.

Input

NameTypeRequiredWhat it is
post_idintegerYesThe post holding the Elementor document.
element_idstringYesThe seven-character hex element ID.
elementobjectYesThe replacement element payload.
force_replacebooleanWhen replacing populated contentRequired when the replacement would remove existing children.

What comes back

NameTypeWhat it is
post_idintegerThe post written.
element_idstringThe ID of the element created or affected.
elementobjectThe element as stored.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Replace that widget with a different one.

It resolves to one call:

{
  "ability": "elementor/update-element",
  "parameters": {
    "post_id": 412,
    "element_id": "a1b2c3d",
    "element": { "elType": "widget", "widgetType": "heading", "settings": { "title": "New" } },
    "force_replace": true
  }
}

Worth knowing

  • Replacement removes every child. The guard exists for exactly that.
  • Use the merge ability for ordinary setting changes.
  • The element ID survives the replacement.
  • Clear the Elementor cache afterwards.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading