Create Template 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 →

Create Template

Write

Create a reusable theme-builder template (header, footer, archive, single, search, 404, popup, WooCommerce, or general) or update the existing singleton header/footer.

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

Creates a pagelayer-template post from the given pagelayer_data layout tree and display conditions. Header and footer types are treated as singletons — if one already exists it is updated in place rather than duplicated — and are always forced to carry an "Include / Full Site" display condition even if the caller's conditions omit it, since a header/footer with no site-wide rule leaves most of the site without one. A header additionally must contain the pl_wp_menu (Primary Menu) widget bound to a real menu unless single_page_site is passed, and the write is rejected before anything is saved if inline CSS is found in rich text or, unless skip_validation is set, the content-quality gate finds placeholder text, invalid attributes, or unregistered widgets. Header/footer rows also get an automatic background color drawn from the site's palette when none was set explicitly, since a transparent row otherwise inherits the theme's own, often mismatched, body color.

See it in action

You ask your AI assistant

"Create a footer template with a copyright notice and social icons."

Inputs

Name Type Required Description
title string Yes Template title.
type string Yes header, footer, blog_archive, single_blog, sidebar, search, 404, popup, woocommerce_shop, woocommerce_product, general.
pagelayer_data object Yes Layout node tree.
conditions array No Display conditions: [{type:"include"|"exclude", template, sub_template, id}]. header/footer templates always get the Include / Full Site rule, added back if omitted.
single_page_site boolean No Only for a header on a genuine one-page site whose nav links are in-page anchors. Opts out of the Primary Menu widget requirement.

Returns

An object with template_id, title, type, and success:true on success, or a WP_Error (invalid_params, header_without_menu, menu_widget_without_menu, menu_not_found, inline_css_not_allowed, or quality_gate_failed) describing what to fix.

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.