Remove Dashboard Widgets from Admin Panel

Every time you install WordPress on your site or on local server, after you login for the first time, you would see bunch of widgets are showing up on your Dashboard, which is kind of annoying. Even though you have the option to disable them (unchecked) them from the “Screen Options” menu (top right hand corner of the screen, in gray color), there are way to remove them.

By removing them, I meant not to have those check box to bring those widgets back. This could be useful, if you want other users or contributing authors to have a cleaner Dashboard.

Simply copy and paste the following snippet on your themes functions.php file. It should remove all of your Dashboard widgets.

<?php
function ib_remove_dashboard_widgets() {
   remove_meta_box('dashboard_browser_nag', 'dashboard', 'normal');
   remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
   remove_meta_box('dashboard_right_now', 'dashboard', 'normal');
   remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
   remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
   remove_meta_box('dashboard_quick_press', 'dashboard', 'side');
   remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side');
   remove_meta_box('dashboard_primary', 'dashboard', 'side');
   remove_meta_box('dashboard_secondary', 'dashboard', 'side');}
add_action('wp_dashboard_setup', 'ib_remove_dashboard_widgets'); 
?>

All we are doing here is creating a simple function to remove widgets and hooking it up with the “ib_dashboard_setup” action to register our function. Definitely, you can bring those options back simply removing this snippet from the functions.php file.

On a personal note, I wouldn’t recommend you to remove “Right Now” widget because this widget gives you comprehensive information about your site like how many posts has been written so far or number of comments you have got etc. You are free to remove any widgets you want though.

Source: WordPress Codex.

Today In History

  •  
  •  

Comment

Leave a Reply

Note: Convet HTML, PHP, JavaScripts from Postable, before posting from comment section.
License: By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution. Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.