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.
emcp-tools/regenerate-css
Section titled “emcp-tools/regenerate-css”New in v3.15.0. Invalidate stale Elementor CSS, render/asset data, and local atomic style caches. Elementor rebuilds them on the next frontend request; the tool does not change page content or purge CDN/third-party caches.
It ships disabled by default. Switch it on in the Page Management section of the Elementor tab on EMCP Tools → Tools, then choose Save changes in the save bar.
// One editable page (default scope).regenerate-css({ post_id: 42 })
// Explicit site-wide invalidation; administrator permission required.regenerate-css({ scope: "site", confirm: true })Page scope requires edit_post on the target. Site scope requires manage_options and confirm: true; omitting a page ID does not silently switch to site scope. Fetch the frontend after invalidation to trigger rebuilding and verify the result.
Combined workflow
Section titled “Combined workflow”To build a new page in one call, use build-page with a title, explicit draft status and a structure. It creates the WordPress page itself; do not call create-page first.
For an incremental build, use:
create-page → get a fresh post_idadd-container → add a section to that pageadd-free-widget → add content to the containerupdate-element → style or revise the saved elementOr, 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.
