Elementor template duplicate
The create_page_draft tool, when targeted at a WordPress site with
page_builder: elementor, supports a template-duplicate workflow: pick an
existing Elementor template + supply key/value variables, the worker clones
the _elementor_data and rewrites placeholder strings.
Prerequisites
Section titled “Prerequisites”- WordPress site registered with
page_builder: elementor(orgutenberg + elementorif multi-builder is enabled) - Elementor installed on the WP site
- For the default MCP backend: paste the
functions.phpsnippet from the setup guide so_elementor_datais exposed via REST. Withwp-mcp-adapterbackend, no snippet needed. - At least one Elementor template saved (any kind: page, section, popup)
- A token whose
allowed_toolsincludescreate_page_draft,update_page_draft,list_page_templates
Discover templates first
Section titled “Discover templates first”list_page_templates site_id="<wp-site-id>"Returns each template’s id, title, and the placeholder tokens detected in its
content (eg {{HERO_H1}}, {{CTA_URL}}).
Create a page from a template
Section titled “Create a page from a template”create_page_draft site_id="<wp-site-id>" page_builder="elementor" title="Pricing — Acme" slug="pricing-acme" elementor_template_id="142" variables={ "HERO_H1": "Smart pricing for growing teams", "HERO_CTA_URL": "/signup", "PLAN_BASIC_PRICE": "$9", "PLAN_PRO_PRICE": "$29" }The worker:
- Fetches the source template’s
_elementor_dataJSON - Replaces every
{{KEY}}literal with the value fromvariables - Throws
E_MISSING_PLACEHOLDERif a{{KEY}}in the template has no value - Creates a new WP page (status=draft) and writes the cloned JSON to
_elementor_data - Returns
{ id, status: "draft", admin_url, url }
Update via re-clone
Section titled “Update via re-clone”update_page_draft with elementor_template_id + variables re-runs the
clone with new values. Useful when copy needs revision but layout stays the
same.
Multi-builder sites
Section titled “Multi-builder sites”If a site has both Gutenberg and Elementor enabled (available_builders
contains both), Claude must pass page_builder explicitly. Without it the
tool throws E_BUILDER_REQUIRED with the available builders listed — use
list_builders_for_site to know in advance.
Hard rule
Section titled “Hard rule”Pages are always created as draft. To publish, open the WordPress admin and click Publish manually.
See also
Section titled “See also”- Pages on WordPress
- Code-first pages — alternative for fully custom layouts