Write Elementor Layout


Replaces a post or page's entire Elementor layout with the element tree you supply, and can build one on a post that has none. Anything not included is removed, so prefer the targeted editing abilities for ordinary changes. Element IDs may be omitted and will be generated. Unknown widget types are refused rather than silently dropped.

Also known as: replace the Elementor layout, build a page with the page builder.

Property Value
Ability slug mosmcp/elementor-page-write
Wire tool name mosmcp__elementor-page-write
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: true · idempotent: false · 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 replaced.
elements object[] Yes — The top-level elements of the layout. Each needs an elType of "container" or "widget"; a widget also needs a widgetType. Settings and nested elements are optional, and ids are generated when omitted.
allow_empty boolean false Required to be true if elements is empty, since that removes the whole layout.
set_edit_mode boolean true Put the post into Elementor builder mode so the layout renders. Defaults to true; without it a written layout is stored but never displayed.
expected_modified string — Optional. The "modified" value from a previous read. The write is refused if the post changed since then.

 

Output schema

Field Type Required Description
id integer Yes
title string
status string The post status, which these abilities never change.
modified string New modified timestamp, usable as expected_modified on a following edit.
changes object[] Yes What actually changed.
changes[].action string Which structural change was made: delete, duplicate or move.
changes[].element_id string The element affected. For a duplicate this is the new copy's ID.
changes[].widget_type string
changes[].detail string Plain-language description of what happened.
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
Build my new 'Careers' page in Elementor with a heading and a short intro paragraph.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 332,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__elementor-page-write",
    "arguments": {
      "input": {
        "id": 95,
        "elements": [
          {
            "elType": "container",
            "settings": {},
            "elements": [
              {
                "elType": "widget",
                "widgetType": "heading",
                "settings": {
                  "title": "Join our team"
                }
              },
              {
                "elType": "widget",
                "widgetType": "text-editor",
                "settings": {
                  "editor": "<p>We are hiring across design and engineering.</p>"
                }
              }
            ]
          }
        ]
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 332,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 95,
      "title": "Careers",
      "status": "draft",
      "modified": "2026-09-29 11:02:47",
      "changes": [
        {
          "action": "replace_layout",
          "element_id": "",
          "widget_type": "",
          "detail": "Layout written: 3 elements."
        }
      ],
      "view_url": "https://example.com/?page_id=95",
      "elementor_url": "https://example.com/wp-admin/post.php?post=95&action=elementor",
      "warnings": [
        {
          "code": "element_ids_minted",
          "message": "3 elements had no ID, so new IDs were generated.",
          "context": "minted=3"
        }
      ]
    }
  }
}

 

Edge cases / errors

  • Empty elements → refusing_to_empty_layout unless allow_empty is true; not an array → invalid_elements.
  • Unknown widget types → unknown_widget_types (whole write refused); element missing elType/widgetType → missing_el_type / missing_widget_type.
  • More than 2000 elements → too_many_elements; nesting deeper than 12 levels → layout_too_deep.
  • Replaces the whole layout; a smaller result raises layout_shrank. A corrupt existing layout is refused rather than overwritten, and expected_modified stale → post_changed.

 


<< Previous Next >>
Read Elementor Layout

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.