Duplicate Template is a WordPress ability from Ultimate Addons for Elementor — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Duplicate Template

Write

Creates a full copy of an existing HFE template, including its Elementor design data, as a new draft.

Requires the Ultimate Addons for Elementor (Header Footer & Elementor) plugin on WordPress 6.9+ (the WP Abilities API). No ability registers unless the plugin's 'Enable AI Tools' master switch (uae_mcp_settings.enable_abilities) is turned on in settings. Most abilities require the 'manage_options' capability; a smaller set of read/discovery abilities (template and page listing, the Elementor builder read/list/schema abilities, active-template lookup, display-rule locations, and design tokens) instead require only 'edit_posts' or 'read'. Abilities that act on a specific page, post, or template additionally check the current user's per-object 'edit_post' (or 'delete_post') capability on that item. Separately, every non-readonly (Write or Destructive) ability is gated behind a site-wide 'Allow Modifications' setting at registration time: if it is off, none of those abilities are even registered with the WP Abilities API, regardless of capability checks — this covers all template/page CRUD, widget/extension toggles, display-rule updates, theme/settings changes, and the Elementor builder writes alike, not just the builder ones. Eight of those abilities (the seven Elementor page-builder writes — build, insert-widget, update-widget, remove-element, move-element, add-section, add-column — plus pages-create) additionally re-check this same setting explicitly inside execute() as a redundant safeguard.

What it does

Validates the source template via validate_template(), then inserts a new 'elementor-hf' draft post (title defaults to "Copy of {original}" if not supplied) authored by the current user. It copies all postmeta rows from the source to the new post (skipping edit-lock and old-slug meta) to preserve the serialized Elementor data exactly, clears the duplicate's cached '_elementor_css', and clears Elementor's file cache if the Elementor plugin class is loaded. Returns the new template's id, title, type, edit URLs, and shortcode.

See it in action

You ask your AI assistant

"Duplicate template 210 and call the copy "Header - Summer Sale"."

Inputs

Name Type Required Description
template_id integer Yes Source template post ID.
title string No Title for the duplicate; defaults to "Copy of {original}".

Returns

An object with id, title, type, edit_url, elementor_edit_url, and shortcode for the new duplicate template.

Permission

Requires current_user_can('manage_options'); execute() also calls validate_template() on the source template, returning 404 if invalid. No check_modifications_allowed call is present.

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.