Deactivate Unused Widgets 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 →

Deactivate Unused Widgets

Destructive

Scans all published Elementor content site-wide and disables any HFE widget not found in use anywhere.

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 no input. Gets a map of used widget slugs and the full widget list, then for every widget not present in the used-widgets map, marks that widget's class name as 'disabled' in the '_hfe_widgets' option (skipping the Scroll to Top and Reading Progress Bar extension classes, since those are site-wide features not tied to specific content). If anything was deactivated, it saves the updated option. Returns the list of deactivated slugs and a count.

See it in action

You ask your AI assistant

"Clean up my HFE widgets by deactivating any that aren't currently used on the site."

Returns

An object with success (boolean), deactivated (array of widget slug strings that were turned off), and deactivated_count (integer).

Permission

Requires current_user_can('manage_options'); metadata instructs the caller to run widgets-get-usage first and get user confirmation, but execute() itself performs no extra gate.

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.