Posted By

RainyDayMedia on 09/21/11


Tagged

php wordpress dashboard wp widgets wordrpess


Versions (?)

Remove ALL Wordpress Dashboard Widgets 3.0+


 / Published in: PHP
 

URL: rainydaymedia.net

For those of use who use Wordpress as a CMS, this gives you the option of hiding all your dashboard widgets, for all users. **Open your theme’s functions.php file located in your theme’s folder. Copy this script, paste it at the bottom of your theme’s function.php file and save it. Go to the dashboard page and everything is gone.

  1. function remove_dashboard_widgets() {
  2. global $wp_meta_boxes;
  3. // For right now information widget
  4. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  5. // For recent comments listing widget
  6. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  7. // For quick press widget
  8. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
  9. // For recent drafts widget
  10. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
  11. // For Plugin information widget
  12. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  13. // For incoming links information widget
  14. unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  15. // For WordPress blog news widget
  16. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  17. // For other WordPress news widget
  18. unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
  19. }
  20. add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );

Report this snippet  

You need to login to post a comment.