Remove Widgets


目录

To remove existing widget developers can simply unregister existing widget by passing the widget name.

Hooks

To do that we need to hook to the elementor/widgets/register action which holds the widgets manager, and pass the widget name to the unregister() method.

Unregistering Widgets

To unregister existing widgets use the following code:

function unregister_widgets( $widgets_manager ) {

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

}
add_action( 'elementor/widgets/register', 'unregister_widgets' );

版本号 #2
由 壳壳虫 创建于 2026-03-26 17:08:44 UTC
由 壳壳虫 更新于 2026-03-26 17:08:44 UTC