Page Management
emcp-tools/create-page
Section titled “emcp-tools/create-page”Creates a new WordPress page or post with Elementor enabled (_elementor_edit_mode = builder + matching template meta).
Input:
title(required): page titlepost_type:pageorpost, defaults topagestatus:publish,draft, orprivate, defaults todrafttemplate: Elementor page template, defaults todefault
Returns: { post_id, edit_url, view_url }.
Capability: publish_pages (or publish_posts for posts), with fallback to edit_pages/edit_posts for drafts.
emcp-tools/update-page-settings
Section titled “emcp-tools/update-page-settings”Updates page-level Elementor settings (the ones in the page settings panel: background, padding, layout mode, custom CSS class, etc.).
Input: post_id, settings (partial settings object, merged with existing).
Returns: { success: true }.
Capability: edit_post on the target.
emcp-tools/delete-page-content
Section titled “emcp-tools/delete-page-content”Removes all Elementor content from a page. The WordPress page record remains; only the _elementor_data meta is cleared. Destructive. Use deliberately.
Input: post_id.
Returns: { success: true }.
Capability: edit_post on the target.
emcp-tools/import-template
Section titled “emcp-tools/import-template”Imports a JSON template structure into a page (replaces existing Elementor content).
Input:
post_idtemplate_json: array of Elementor element objects in the standard export shape
Returns: { success: true, element_count }.
Capability: edit_post on the target.
emcp-tools/export-page
Section titled “emcp-tools/export-page”Exports a page’s full Elementor data as JSON. Useful for backup, version control, or copying between sites.
Input: post_id.
Returns: { post_id, title, data: [...] }.
Capability: edit_post on the target.
Combined workflow
Section titled “Combined workflow”Building a page from scratch usually looks like:
create-page → get a fresh post_idbuild-page (composite) → emit the full structure in one callOr, if you’re working from a template:
list-templates → find the template IDcreate-page → fresh post_idapply-template → copy template into the new pageFor editing existing pages, prefer update-element / batch-update over import-template. The latter wipes all existing content first.