Disable dashboard Widgets

This snippet disables dashboard widgets, like Right Now or Incoming Links. You can find all the dashboard widgets here: WordPress.org.

It’s also possible to add your own dashboard widgets.

Code Snippet:

<?php
function remove_dashboard_widgets() {
  global $wp_meta_boxes;
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'normal'&#93;&#91;'core'&#93;&#91;'dashboard_plugins'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'normal'&#93;&#91;'core'&#93;&#91;'dashboard_recent_comments'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'normal'&#93;&#91;'core'&#93;&#91;'dashboard_incoming_links'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'normal'&#93;&#91;'core'&#93;&#91;'dashboard_right_now'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'side'&#93;&#91;'core'&#93;&#91;'dashboard_primary'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'side'&#93;&#91;'core'&#93;&#91;'dashboard_secondary'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'side'&#93;&#91;'core'&#93;&#91;'dashboard_quick_press'&#93;);
  unset($wp_meta_boxes&#91;'dashboard'&#93;&#91;'side'&#93;&#91;'core'&#93;&#91;'dashboard_recent_drafts'&#93;);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
?>

Posted in Admin area