WPBakery
These abilities register when WPBakery is detected on the site and a Pro licence is active. If either is missing the module stays absent rather than failing at call time.
At a glance
WPBakery registers 18 abilities: 7 that only read, 8 that write, and 3 marked destructive. That split is the practical answer to how much of this module can run unattended. Reads cost nothing and are safe to repeat, so discovery is the part to be generous with; the writes are where review belongs, and the destructive calls stop for an explicit confirmation every single time regardless of which profile is active.
What this module is for
Inspect serialized WPBakery content, discover elements and schemas, edit or move elements, and manage settings without treating the page as plain text.
Before you rely on it: Always inspect and validate serialized content before publishing because malformed structures can break the editor.
Typical workflows
- Inspect shortcodes and element structure before an edit
- Apply a known template to a reviewed page
- Edit several related elements without replacing unrelated content
The WPBakery integration page covers the same module from the workflow side, with the capability map and the questions worth asking before a first write.
Availability on your site
The WPBakery module needs three things at once: WPPilot Free as the MCP foundation, an active Pro licence, and the companion plugin detected on the site. Miss any one and the module does not register, which is deliberate: an ability that appears in the tool list but fails at call time is worse than an ability that was never offered. What the connected agent can actually call is then narrowed twice more: by the safety profile active on the site, and by the WordPress capabilities of the user behind the credential. A read that succeeds for an administrator can be absent entirely for an editor.
Every write these abilities perform is recorded in the change ledger, and destructive calls can be routed through the approval queue so a person signs off before anything is applied. A successful tool result means the operation returned, not that the front end, the cache, and every dependent template are correct: that still needs a look.
Reads
Available in every safety profile, including Read Only. Inspection costs nothing and is not rate limited.
| Ability | What it does |
|---|---|
wppilot/wpbakery-check-setupCheck WPBakery Setup | Reports the WPBakery Page Builder environment: version and minimum-version status, registered element count and categories, Grid Builder availability, post types where WPBakery is enabled, and the current user's management permission. Call BEFORE any other WPBakery ability so the agent can plan around what is and is not available on this site. |
wppilot/wpbakery-get-contentGet WPBakery Content | Returns the WPBakery element tree for a post as a nested JSON structure under the tree field. Each node has tag, atts (decoded), children, and _idx (depth-first index used by add/edit/delete operations). vc_link values are decoded to {url, title, target, rel} objects; param_group values are decoded to arrays. Container elements that hold raw HTML (e.g. vc_column_text) expose a _content field with the inner HTML. The returned tree can be passed verbatim to wpbakery-set-content for a round-trip. |
wppilot/wpbakery-get-element-schemaGet WPBakery Element Schema | Returns the compact control schema for a single WPBakery element (tag, label, is_container, categories, controls, common_controls). controls is the element-specific param map; common_controls is the four universal atts (el_id, el_class, css, css_animation) that every WPBakery element accepts on top of its own schema — these never appear in the WPBakery param registry so they would otherwise be invisible to discovery. Call this right before authoring via add-element / edit-element / set-content. Use wpbakery-list-elements first to find the tag. |
wppilot/wpbakery-get-settingsGet WPBakery Settings | Reads the WPBakery-owned meta on a post: wpbakery_edited flag (mirrors _wpb_vc_js_status), page-level custom_css (free-form CSS the user authors, postmeta _wpb_post_custom_css — this is what most agents care about), and shortcodes_custom_css (auto-generated by WPBakery from every element's css Design Options att, rebuilt on save — read-mostly, rarely written). Use this to verify a post was correctly marked as WPBakery-edited before opening the editor, or to read the current page-level CSS before patching it. |
wppilot/wpbakery-list-elementsList WPBakery Elements | Lists registered WPBakery elements as a compact overview: tag, label, is_container, categories. Call this to browse the element catalogue, then call wpbakery-get-element-schema with a specific tag to inspect that element's control schema before authoring. Use tag_contains ("heading", "btn", "grid", …) to filter by substring when you already know roughly what element you want. |
wppilot/wpbakery-list-grid-item-elementsList WPBakery Grid Item Elements | Lists the vc_gitem_* shortcodes used inside vc_grid_item template posts (the per-item layout consumed by vc_basic_grid / vc_masonry_grid via the item att). Each entry includes the tag, a short purpose, the is_container flag, and the most-used atts with a one-line description. The response also includes a dynamic_links block listing the magic string values (post_link, image, image_lightbox, custom, none) that link atts on vc_btn / vc_gitem_image / vc_gitem_zone_* accept inside a grid_item context — these bypass the normal vc_link object encoding and are resolved against the current loop post at render time. These shortcodes are not in the global WPBakery registry, so they are not returned by wpbakery-list-elements; call this ability whenever you are building or editing a vc_grid_item template. |
wppilot/wpbakery-list-templatesList WPBakery Templates | Lists saved WPBakery user templates. Optionally filter by category. Returns template_id, name, category, and a short shortcode preview for each template. |
Writes
Gated by the active profile and your WordPress capabilities. Rate limited to 120 per minute per credential.
| Ability | What it does |
|---|---|
wppilot/wpbakery-add-elementAdd WPBakery Element | Inserts a new WPBakery element (or a whole subtree) into a post. The element input is a node {tag, atts, children?, _content?} — the exact same shape wpbakery-set-content / wpbakery-get-content / wpbakery-inspect-page use for tree nodes, so a subtree captured from one can be passed verbatim here. parent_idx is the _idx of the target container (null for root) and position is the 0-based offset (-1 to append). On invalid top-level atts the response returns invalid_values[] with each bad key's value and the full inline opts list. Atts inside nested element.children get a soft post-write invalid_atts array (write still succeeds). Non-WPBakery shortcodes elsewhere in post_content are preserved and listed in preserved_foreign_shortcodes. Remaining nodes get re-indexed depth-first after the insert; call wpbakery-get-content again before targeting another _idx. |
wppilot/wpbakery-create-templateCreate WPBakery Template | Creates a reusable WPBakery template from a layout. Provide either (post_id + element_idx) to capture an element from a page, or a raw shortcode string. The template appears in the WPBakery editor under "My Templates" and can be re-applied with wpbakery-apply-template. |
wppilot/wpbakery-edit-elementEdit WPBakery Element | Updates an existing WPBakery element identified by its _idx (from wpbakery-get-content). By default merges new atts (omitted keys keep their current value); pass replace=true to discard every existing att and use only the provided ones. To update the inner HTML of elements like vc_column_text, pass _content at the top level (sibling of atts, mirroring the node shape that set-content / get-content / add-element use). On invalid atts the response returns invalid_values[] with each bad key's value and the full inline opts list — pick a valid choice and retry, no separate get-element-schema call needed. |
wppilot/wpbakery-edit-elementsEdit Multiple WPBakery Elements | Applies one or more atts updates across multiple WPBakery elements in a single atomic write. Input shape: {post_id, edits: [{match, atts, replace?}, …]} — edits is ALWAYS an array, even for a single rule. Each rule's match selects nodes by tag and/or element_idxs (AND when both present), and the rule's atts are merged (or replaced wholesale when replace=true). Example: edits: [{"match":{"tag":"vc_btn"},"atts":{"color":"blue","size":"lg"}}]. Atts are NOT schema-validated per match (use wpbakery-edit-element on a single node when validation matters). Returns the deduplicated list of element_idxs touched, plus the standard preserved_foreign_shortcodes field when applicable. |
wppilot/wpbakery-inspect-pageInspect WPBakery Page | Read-only aggregate snapshot of a WPBakery-edited post: setup snapshot (version, min_satisfied, grid_builder_active, supported_post_types), per-post settings (wpbakery_edited flag, custom_css, shortcodes_custom_css), the WPBakery element tree, and a list of foreign shortcodes ([gallery], [wpforms], [contact-form-7], …) that are in the raw post_content but outside the WPBakery tree. Use this BEFORE planning a mutation so you know what is on the page (including content that get-content alone does not surface). |
wppilot/wpbakery-move-elementMove WPBakery Element | Detaches the element identified by element_idx and reinserts it under parent_idx at position. WITHIN a single move call source and target are resolved in one tree snapshot, so the intermediate _idx renumbering that would happen with a manual delete-then-add does not bite. BETWEEN separate move calls _idx still renumbers — call wpbakery-get-content again before issuing the next move. Use null parent_idx to move to the root level; use position=-1 to append at the end of the target container. Input names mirror wpbakery-add-element — parent_idx and position refer to the TARGET (where the element ends up), element_idx refers to the SOURCE. Non-WPBakery shortcodes elsewhere in post_content are preserved and listed in preserved_foreign_shortcodes. |
wppilot/wpbakery-set-contentSet WPBakery Content | Replaces the entire WPBakery layout of a post with the provided element tree. Each node has shape {tag, atts, children, _content}: children is the recursive nesting key, atts uses {url,title,target,rel} for vc_link and arrays of objects for param_group, _content carries raw inner HTML for elements like vc_column_text. The top-level param is tree (the array of root nodes). Pass tree: [] to wipe the WPBakery layout entirely. The post is marked as a WPBakery page automatically. Pass custom_css to set the page-level CSS in the same call (avoids a separate wpbakery-set-settings round-trip). Non-WPBakery shortcodes elsewhere in post_content (e.g. [contact-form-7], [gallery]) are preserved and re-appended after the saved WPBakery tree; the response lists them in preserved_foreign_shortcodes when present. |
wppilot/wpbakery-set-settingsSet WPBakery Settings | Writes WPBakery-owned meta on a post. Pass wpbakery_edited: true to mark the post as a WPBakery page (sets _wpb_vc_js_status to the literal string "true" so the "Edit with WPBakery" admin link appears and the frontend assets load). Pass custom_css to set the page-level custom CSS textarea. Pass shortcodes_custom_css to overwrite the CSS WPBakery generates from element Design Options — usually you should leave this alone and let WPBakery regenerate it. Only the keys explicitly provided in the input are updated. |
Destructive
Marked destructive in the source, so each call needs an explicit confirmation flag, every time.
| Ability | What it does |
|---|---|
wppilot/wpbakery-apply-templateApply WPBakery Template | Applies a saved WPBakery template to a post. mode=append adds the template after the existing content (default, non-destructive); mode=prepend adds it before (non-destructive); mode=replace DISCARDS every existing WPBakery node on the target and uses only the template (destructive, warn the user first). Non-WPBakery shortcodes elsewhere in post_content (e.g. [contact-form-7]) survive any mode and are listed in preserved_foreign_shortcodes when present. _idx values are reassigned after the apply; call wpbakery-get-content again before targeting an _idx on the target. |
wppilot/wpbakery-delete-elementDelete WPBakery Element | Permanently removes a WPBakery element and all its children from a post, identified by _idx (from wpbakery-get-content). Deleting a container (vc_row, vc_column) removes all nested content inside it. Non-WPBakery shortcodes elsewhere in post_content (e.g. [contact-form-7], [gallery]) are preserved and re-appended after the saved WPBakery tree; the response lists them in preserved_foreign_shortcodes when present. Remaining nodes get re-indexed depth-first after the delete, so call wpbakery-get-content again before targeting another _idx. |
wppilot/wpbakery-delete-templateDelete WPBakery Template | Permanently deletes a saved WPBakery template by its id (from wpbakery-list-templates). |