How to disable unused widgets. Wordpress open

How to disable unused widgets. Wordpress

Approved. Code works!
This is exactly the working code that is verified by the moderator or site administrators
Tested: Wordress 4.0+, PHP 5.6 +

Place this code in your function.php file
If you want to leave a widget just delete the string with its name


function remove_default_widget() {
	unregister_widget('WP_Widget_Archives'); // Archive widget
	unregister_widget('WP_Widget_Calendar'); // Calendar widget
	unregister_widget('WP_Widget_Categories'); // Categories widget
	unregister_widget('WP_Widget_Meta'); // Meta widget
	unregister_widget('WP_Widget_Pages'); // Pages widget
	unregister_widget('WP_Widget_Recent_Comments'); //  Latest comments
	unregister_widget('WP_Widget_Recent_Posts'); // Latest Post
	unregister_widget('WP_Widget_RSS'); // RSS widget
	unregister_widget('WP_Widget_Search'); // Search widget
	unregister_widget('WP_Widget_Tag_Cloud'); // Tag widget
	unregister_widget('WP_Widget_Text'); // Custom text widget
	unregister_widget('WP_Nav_Menu_Widget'); // Menu widget
}
 
add_action( 'widgets_init', 'remove_default_widget', 20 );

0

More

Leave a Reply

Your email address will not be published. Required fields are marked *

How many?: 22 + 22

lil-code© | 2022 - 2024
Go Top
Authorization
*
*
Registration
*
*
*
*
Password generation