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

Start free trial

Delete Elementor Element

elementor/delete-element removes the element at a given ID, and everything nested inside it.

Populated and top-level elements need force_delete.

Before you run it

Deleting an element deletes everything inside it. A container holding a whole page section goes with one call, and there is no trash for Elementor elements — the only recovery is a WordPress revision of the post, if revisions are enabled and one was taken. force_delete is required for populated or top-level elements precisely because those are the expensive mistakes.

At a glance

Abilityelementor/delete-element
ToolsetElementor — toolset/elementor
GroupElementor › Elements & Widgets
RequiresElementor, active on the site
Capabilitymanage_options
SafetyDestructive — removes the element and everything inside it. Guarded by force_delete for populated or top-level elements.
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

The guard is scoped to where the damage is. Deleting an empty widget is cheap and needs no ceremony; deleting a top-level container that holds a third of the page is not, and the two calls otherwise look identical.

So the flag is required exactly where the deletion removes content somebody would miss.

There is no trash. Elementor elements are part of a serialised blob rather than posts, so nothing takes a copy on the way out.

A WordPress revision of the post is the only recovery, and it only exists if revisions are enabled and one was taken since the content was added. Reading the element first with elementor/get-element at least gives you the payload to put back.

Not idempotent, though deleting an ID that is already gone is reported rather than silently succeeding.

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.
force_deletebooleanFor populated or top-level elementsRequired when the element has children or sits at the document root.

What comes back

NameTypeWhat it is
post_idintegerThe post written.
deleted_idstringThe element removed.
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:

Delete that empty container.

It resolves to one call:

{
  "ability": "elementor/delete-element",
  "parameters": {
    "post_id": 412,
    "element_id": "a1b2c3d"
  }
}

Worth knowing

  • Everything inside goes too. There is no trash for Elementor elements.
  • Read the element first — that payload is your only copy.
  • Post revisions are the only other recovery, if enabled.
  • 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