Hello friend, hope you are doing good. In today’s tutorial, I will explain “How to Remove Dashboard Widgets in WordPress”. This will help you lot if you are developing the site your client and want to remove unused things from WordPress dashboard.
Open your functions.php file and add below code at the end of this file and save. This function will remove the widgets from your admin dashboard.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<?php //How to Remove Dashboard Widgets in WordPress add_action('wp_dashboard_setup', 'btwp_remove_dashboard_widgets'); function btwp_remove_dashboard_widgets() { global $wp_meta_boxes; unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); } ?> |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: remove dashboard, remove dashboard access, wordpress disable dashboard, wordpress remove, wordpress user dashboard