# Unregistering Widgets

Elementor Core Intermediate

Developers can remove Elementor widgets from the list of registered widgets. This is done by hooking to the widget manager and unregistering specific widgets by passing the widget name.

# Unregistering Existing Widgets

As of Elementor 3.5, developers should use the following code to unregister existing widgets:

/**
 * Unregister Elementor widgets.
 *
 * @param \Elementor\Widgets_Manager $widgets_manager Elementor widgets manager.
 * @return void
 */
function unregister_widgets( $widgets_manager ) {

	$widgets_manager->unregister( 'widget-1' );
	$widgets_manager->unregister( 'widget-2' );

}
add_action( 'elementor/widgets/register', 'unregister_widgets' );
1
2
3
4
5
6
7
8
9
10
11
12
13

This hooks to the elementor/widgets/register action hook which holds the widget manager. The manager then unregisters widgets by passing the widget name.