Skip to content

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.

  • WordPress site registered with page_builder: elementor (or gutenberg + elementor if multi-builder is enabled)
  • Elementor installed on the WP site
  • For the default MCP backend: paste the functions.php snippet from the setup guide so _elementor_data is exposed via REST. With wp-mcp-adapter backend, no snippet needed.
  • At least one Elementor template saved (any kind: page, section, popup)
  • A token whose allowed_tools includes create_page_draft, update_page_draft, list_page_templates
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_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:

  1. Fetches the source template’s _elementor_data JSON
  2. Replaces every {{KEY}} literal with the value from variables
  3. Throws E_MISSING_PLACEHOLDER if a {{KEY}} in the template has no value
  4. Creates a new WP page (status=draft) and writes the cloned JSON to _elementor_data
  5. Returns { id, status: "draft", admin_url, url }

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.

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.

Pages are always created as draft. To publish, open the WordPress admin and click Publish manually.