Edit Elementor Element Content


Changes the text, image or link of a single element inside an Elementor layout, leaving the design untouched. Only content settings can be reached, so this cannot change an element's colour, font or spacing settings. Markup is handled exactly as in Elementor's editor: users with the unfiltered_html capability can store any HTML, including <script>, <style>, <svg> and <canvas> in an HTML widget (which also needs Elementor's HTML-widget permission); markup a user is not allowed to store is refused with the reason, never silently removed. To change only part of a long text or a large HTML widget, use mosmcp/elementor-element-patch instead of sending the whole value. Read the layout first to get the element_id you want to change.

Also known as: edit Elementor text, change heading, change button text, edit HTML widget code, page builder content.

Property Value
Ability slug mosmcp/elementor-element-set-content
Wire tool name mosmcp__elementor-element-set-content
Category Elementor (mosmcp-elementor)
Plan Free

 

Required access

Requirement Value
Capability edit_post (checked against the specific post)
Minimum default role Contributor
Annotations readOnly: false · destructive: false · idempotent: true · openWorld: true

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The ID of the post or page whose layout should be edited.
element_id string (min length 1) Yes — The Elementor element ID to change, as reported when reading the layout.
text string — New primary text — a heading's title, a button's label, a text block's body, or an HTML widget's code.
body string — New secondary text, for widgets that have both a title and a description.
image_id integer (min 1) — Media library ID of an image to use for this element.
link_url string — New link target: a full http(s) URL, a site-relative path starting with /, or an anchor starting with #.
expected_modified string — Optional. The "modified" value from a previous read. The edit is refused if the post changed since then, so a concurrent edit is never overwritten.

 

Output schema

Field Type Required Description
id integer Yes
title string
status string The post status, which this ability never changes.
modified string New modified timestamp, usable as expected_modified on a following edit.
changes object[] Yes What actually changed. Empty is never returned; a no-op request is refused instead.
changes[].element_id string
changes[].widget_type string
changes[].role string Which content role was written: text, body, image or link.
changes[].control string The Elementor setting that was written.
changes[].previous string
changes[].current string
view_url string
elementor_url string
warnings object[] Non-fatal issues encountered while running.
warnings[].code string
warnings[].message string
warnings[].context string

 

Example

Sample prompt
Change the main heading on my home page to 'Built for growing teams'.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 323,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__elementor-element-set-content",
    "arguments": {
      "input": {
        "id": 12,
        "element_id": "3f9a1c2",
        "text": "Built for growing teams"
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 323,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 12,
      "title": "Home",
      "status": "publish",
      "modified": "2026-09-29 10:30:02",
      "changes": [
        {
          "element_id": "3f9a1c2",
          "widget_type": "heading",
          "role": "text",
          "control": "title",
          "previous": "Welcome to Example Co.",
          "current": "Built for growing teams"
        }
      ],
      "view_url": "https://example.com/",
      "elementor_url": "https://example.com/wp-admin/post.php?post=12&action=elementor",
      "warnings": []
    }
  }
}

 

Edge cases / errors

  • None of text, body, image_id, link_url given → nothing_to_set; a role the widget doesn't have (e.g. link_url on a heading without a link) → role_not_supported.
  • element_id not in the layout → element_not_found; ID shared by several elements → element_id_ambiguous; expected_modified stale → post_changed.
  • Bad link_url (not http(s), /path or #anchor) → invalid_link_url; image_id not an image → attachment_not_found / attachment_not_an_image.
  • Saved straight to the live post (the revision history is the way back); post type not enabled in Elementor → post_type_not_builder_enabled; same value already set → nothing_changed.

 


<< Previous Next >>
Duplicate Elementor Element Edit Elementor Element Styling

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.