How to remove dashboard widgets in WordPress admin

How can I hide widget from dashboard admin in WordPress?

Insert this code on your plugin:

<?php
/*
* Remove dashboard widgets
*
*/
add_action('wp_dashboard_setup', 'wpster_remove_dashboard_widgets' );
function wpster_remove_dashboard_widgets() {
	// Remove Welcome panel
	remove_action( 'welcome_panel', 'wp_welcome_panel' );
	// Remove the rest of the dashboard widgets
	remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
	remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
	remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
	remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' );
	remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal' );
}
?>

Submit a Comment

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