Insert WPBakery Element
Adds an element (text block, heading, button, image, separator, empty space…) to a column: either a new one of element_type, built from WPBakery's own element definition (only settings it defines are accepted; the rest keep WPBakery's defaults), or a copy of source_element_id already on the page (needed for tabs/accordions), optionally with new content, attributes or link. A copy's HTML id is cleared and tab ids are renewed so nothing is duplicated. Changes the live page; reversible from the backup the result names. Needs layout_hash and element ids from mosmcp/wpbakery-read-page-layout.
Also known as: add text, add button, add image, duplicate element.
| Property | Value |
|---|---|
| Ability slug | mosmcp/wpbakery-insert-element |
| Wire tool name | mosmcp__wpbakery-insert-element |
| Category | WPBakery Page Builder (mosmcp-wpbakery) |
| Plan | Pro |
Required access
| Requirement | Value |
|---|---|
| Capability | edit_post (checked against the specific post) |
| Minimum default role | Contributor |
| Annotations | readOnly: false · destructive: false · idempotent: false · openWorld: false |
Input schema
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| post_id | integer (min 1) | Yes | — | The post or page ID. |
| layout_hash | string | Yes | — | The layout_hash from your latest mosmcp/wpbakery-read-page-layout (or a previous change's result). The change is refused if the page changed since. |
| element_type | string | — | Shortcode of a new element to build, for example "vc_column_text", "vc_btn", "vc_custom_heading", "vc_single_image", "vc_empty_space". Needs target_column_id. Give this or source_element_id. | |
| source_element_id | string | — | element_id of an element to copy (not a row or column; use mosmcp/wpbakery-insert-row for those). | |
| target_column_id | string | — | element_id of the vc_column, vc_column_inner or vc_tta_section to put it in. Optional for a copy (default: right after the source). | |
| position | integer (min 0) | — | Optional zero-based position among the target's elements. Omit to place it after the source (same column) or last. | |
| content | string | — | Optional. New inner content (HTML allowed) for an element that has some, such as vc_column_text. May not contain WPBakery shortcodes. | |
| attributes | object | — | Optional. Attribute name => new plain value, for example {"title": "Buy now"} on vc_btn, {"text": "Welcome"} on vc_custom_heading, {"image": "123"} on vc_single_image. WPBakery's escaping is applied for you. An empty string removes the attribute. css (use update-design-options), el_id on a copy and tab_id cannot be set here. | |
| link | object | — | ||
| link.url | string | Yes | — | |
| link.title | string | — | ||
| link.target | string (one of `,_blank`) |
— | ||
| link.rel | string (one of `,nofollow`) |
— |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| post_id | integer | Yes | |
| title | string | ||
| layout_hash | string | Yes | The new layout hash, for a following change. |
| previous_layout_hash | string | ||
| backup | object | Yes | |
| backup.backup_id | string | ||
| backup.revision_id | integer | ||
| backup.meta_name | string | ||
| backup.restore | string | How to undo this change. | |
| css_rebuilt_by | string | "wpbakery" (its own rebuild), "mosmcp" (patched directly), "unchanged", or "none" (failed; see warnings). | |
| edit_url | string | ||
| view_url | string | ||
| warnings | object[] | Non-fatal issues encountered while running. | |
| warnings[].code | string | ||
| warnings[].message | string | ||
| warnings[].context | string | ||
| notes | string[] | ||
| inserted_ids | string[] | element_id of each inserted top node, valid against the new layout_hash. | |
| tag | string | ||
| parent_id | string | Where it went: "" for the top level. | |
| element_count | integer | Elements added, counting everything inside. |
| << Previous | Next >> |
|---|---|
| Get WPBakery Element | Insert WPBakery Row |
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.