Add Element is a WordPress ability from Page Builder: Pagelayer – Drag and Drop website builder — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Add Element

Write

Insert a new element node into a page at a given parent container and index.

Requires the Pagelayer plugin on WordPress 6.9+ (or another source of wp_register_ability()) for the Abilities API — registration is skipped entirely via a function_exists() guard when it isn't available, and ability categories similarly require wp_register_ability_category(). Most abilities require the 'edit_posts' capability; update-global-styles, create-menu, and delete-menu require 'manage_options'. search-images additionally needs a Pexels API key configured on the Pagelayer AI Agents settings page, and get-library-sections/import-library-section call Pagelayer's own hosted library API. Four near-duplicate abilities (get-widget, get-widgets-summary, edit-layout, navigator) are registered in source with mcp_public:false — fully callable over the REST Abilities API but intentionally left out of the advertised MCP tool list as duplicates of get-widget-schema, list-widgets, update-page, and get-page respectively — and are excluded from this listing.

What it does

Normalizes and inserts a new node, assigning it a fresh pagelayer-id, either at the top level of the page or inside a named parent_id container at an optional index, after the inline-CSS scrub and, unless skip_validation is set, content-quality gate on just the new element.

See it in action

You ask your AI assistant

"Add a new call-to-action button inside column a8fn5 on page 128."

Inputs

Name Type Required Description
post_id integer Yes Page post ID.
parent_id string No Container node to insert into.
element object Yes New node to insert.
index integer No Position within the target container.
skip_validation boolean No Bypass the content-quality gate.

Returns

An object with success:true and element_id (the new node's pagelayer-id), or a WP_Error if the parent isn't found or the new element fails inline-CSS/quality checks.

Permission

Requires the 'edit_posts' capability.

Newsletter

The AI + WordPress space moves fast. Keep up.

New tools, workflow ideas, and product updates — be the first to know what's next.

No spam, unsubscribe anytime.