Save Section 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 →

Save Section Template

Write

Save a page's full layout, or one specific element within it, to the local reusable template library.

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

Reads the pagelayer-data of the given post_id and stores it under a name in the pagelayer_template_library option, keyed by template_name, overwriting any existing entry with the same name. When element_id is supplied, only that one node (resolved via pagelayer-id or an "@0.1.2" position path) is saved rather than the whole page. Saved entries can later be placed elsewhere with insert-template.

See it in action

You ask your AI assistant

"Save the hero section from page 128 as a reusable template called "Hero Standard"."

Inputs

Name Type Required Description
name string Yes Template library name.
post_id integer Yes Source post/page ID.
element_id string No Save just this one node instead of the whole page.

Returns

An object with success:true, or a WP_Error if the post has no layout data or the named element isn't found.

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.