Insert Widget is a WordPress ability from Ultimate Addons for Elementor — usable via Easy MCP AI, which connects Claude, ChatGPT, and any AI assistant to your site.

Install Free Plugin →

Insert Widget

Write

Inserts a single new widget into an existing Elementor post at a specified position.

Requires the Ultimate Addons for Elementor (Header Footer & Elementor) plugin on WordPress 6.9+ (the WP Abilities API). No ability registers unless the plugin's 'Enable AI Tools' master switch (uae_mcp_settings.enable_abilities) is turned on in settings. Most abilities require the 'manage_options' capability; a smaller set of read/discovery abilities (template and page listing, the Elementor builder read/list/schema abilities, active-template lookup, display-rule locations, and design tokens) instead require only 'edit_posts' or 'read'. Abilities that act on a specific page, post, or template additionally check the current user's per-object 'edit_post' (or 'delete_post') capability on that item. Separately, every non-readonly (Write or Destructive) ability is gated behind a site-wide 'Allow Modifications' setting at registration time: if it is off, none of those abilities are even registered with the WP Abilities API, regardless of capability checks — this covers all template/page CRUD, widget/extension toggles, display-rule updates, theme/settings changes, and the Elementor builder writes alike, not just the builder ones. Eight of those abilities (the seven Elementor page-builder writes — build, insert-widget, update-widget, remove-element, move-element, add-section, add-column — plus pages-create) additionally re-check this same setting explicitly inside execute() as a redundant safeguard.

What it does

Takes a post_id, a widget_type slug (validated against the plugin's widget allow-list, which also reports if a required companion plugin is inactive), a settings JSON string (defaults to '{}'), and a position ('append', 'prepend', a numeric index, or an object like {"after":"id"}/{"before":"id"}/{"inside":"id"}). It builds the widget element, inserts it into the existing element tree, and saves the updated tree back to the post. Its instructions say this is for adding one widget incrementally, not for building a layout from scratch, and recommend calling builder-get-structure first to find the right position.

See it in action

You ask your AI assistant

"Add a button widget after element abc123 in post 42, with text "Get Started" linking to /signup."

Inputs

Name Type Required Description
post_id integer Yes Any Elementor-enabled post ID (page, post, or HFE template).
widget_type string Yes Widget type slug (e.g. "navigation-menu", "site-logo", "heading"); discoverable via builder-list-widget-types.
settings string No JSON string of widget settings (default '{}'); keys discoverable via builder-get-schema.
position string|integer|object No Where to insert: "append" (default), "prepend", a numeric index, or {"after":"id"}/{"before":"id"}/{"inside":"id"}.

Returns

Returns success, the new element_id assigned to the inserted widget, and a human-readable message.

Permission

permission_callback requires current_user_can('edit_posts'); execute() additionally calls check_modifications_allowed() (403 unless 'Allow Modifications' is on) and validate_elementor_post() (confirms the post is Elementor-editable and checks current_user_can('edit_post', ID)).

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.