Insert Widget is a WordPress ability from Premium Addons for Elementor — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.
Install Free Plugin →Insert Widget
WriteInsert any registered classic (v3) Elementor widget into a page with its settings, in one call.
Requires the Premium Addons for Elementor plugin on WordPress 7.0+ for the Abilities API (abilities are registered only when the wp_register_ability() function exists). Dashboard, settings and site-inventory abilities (get-id-by-title, list-pages, list-templates, get-global-settings, get-settings, update-setting, scan-usage, disable-unused-widgets, clear-dynamic-assets, subscribe-newsletter) require the caller hold the 'manage_options' capability. premium-addons/create-page requires 'edit_pages'. premium-addons/get-widget-schema, premium-addons/get-addon-schema, premium-addons/list-available-elements, premium-addons/list-pa-addons, premium-addons/detect-atomic-support, premium-addons/check-elementor-element and premium-addons/create-elementor-template require 'edit_posts'. premium-addons/get-page-structure, premium-addons/get-element-settings, premium-addons/add-flexbox, premium-addons/add-container, premium-addons/update-element-settings, premium-addons/insert-widget, premium-addons/remove-element, premium-addons/change-post-status and premium-addons/duplicate-post require 'edit_post' on the target post_id, and deny requests for a nonexistent post_id outright.
What it does
This ability inserts a new classic (v3) widget — any registered Elementor or Premium Addons widget, identified by widget_type (e.g. premium-carousel, heading, button) — into a page, post or template, either at the document root or nested inside an existing container at a given position. It primes Elementor's widget registry first since elementor/widgets/register may not have fired yet on a raw REST/MCP request, then verifies the widget type is actually registered — a Premium Addons widget disabled from the dashboard never registers, and Document::save() would otherwise silently drop it. Atomic (v4) widgets are explicitly rejected with a clear error, since they store props and styles in a different shape this ability doesn't build yet — use widgets that predate Elementor v4 atomic widgets, or build with premium-addons/add-flexbox instead. Setting keys you pass that aren't real controls on the widget are reported back in unknown_keys rather than silently discarded by Elementor, and any group-prerequisite toggle your values need but didn't set (e.g. background_color without background_background=classic) is auto-filled and echoed in auto_set, so the settings you asked for actually take visible effect. Call premium-addons/get-widget-schema for the widget_type first to get its exact control keys.
See it in action
You ask your AI assistant
"Insert a premium-carousel widget into the homepage container with 3 slides and autoplay enabled."
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| post_id | integer | Yes | The ID of the Elementor page, post or template to insert the widget into. |
| widget_type | string | Yes | The widget type name to insert (e.g. premium-carousel, heading, button). Must be registered — a Premium Addons widget disabled in the dashboard is not. |
| settings | object | No | The widget settings as native control keys. Call premium-addons/get-widget-schema for this widget_type first to get the exact keys, types and prerequisites. Repeater controls take an array of row objects. Keys Elementor does not know are reported in unknown_keys, not rejected. Group prerequisite toggles you omit (e.g. background_background for background_color) are auto-set and echoed in auto_set. |
| parent_id | string | No | The id of an existing container element to nest the widget inside. Omit to insert at the document root. |
| position | integer | No | Zero-based index among the parent's children. Omit to append at the end. |
Returns
An object with element_id (the id of the new widget element), post_id, widget_type, unknown_keys (array of setting keys passed that aren't real controls on this widget, kept out of the saved settings), and auto_set (group prerequisite toggles that were auto-set to make the passed values take effect, toggle key => value).
Permission
The current user must have the 'edit_post' capability for the target post_id, checked via Helpers::can_edit_input_post(); requests for a nonexistent post_id are denied outright.
More Premium Addons for Elementor abilities
Add Container (Elementor v3)
Add a new Elementor v3 (classic) container to a page, with layout, background, border and spacing already set.
Add Flexbox (Elementor v4 atomic)
Add a new Elementor v4 atomic flexbox container to a page, with layout, background, border and spacing already set.
Change Post Status
Change the status of a page, post or Elementor template (e.g. draft to publish).
Check Copy Compatibility
Check whether this site can render elements copied from another site via a transfer URL, before actually importing them.
Check Elementor Element
Check whether a specific element or widget type is registered on the site before trying to build with it.
Clear Premium Addons Dynamic Assets
Clear generated dynamic CSS/JS asset files and purge the related caches.