WordPress.org

Codex

Plugin API/Action Reference/wp dashboard setup

Contents

Description

This hook grants access to Dashboard-related customization options. In particular, this hook is used for adding or removing dashboard widgets from WordPress.

To add a dashboard widget, use wp_add_dashboard_widget()

To remove a dashboard widget, use remove_meta_box()

Examples

To Remove a Dashboard Widget

To remove a dashboard widget, call remove_meta_box() within the hooked function.

add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

function remove_dashboard_widgets () {

      //Completely remove various dashboard widgets (remember they can also be HIDDEN from admin)
      remove_meta_box( 'dashboard_quick_press',   'dashboard', 'side' );      //Quick Press widget
      remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );      //Recent Drafts
      remove_meta_box( 'dashboard_primary',       'dashboard', 'side' );      //WordPress.com Blog
      remove_meta_box( 'dashboard_secondary',     'dashboard', 'side' );      //Other WordPress News
      remove_meta_box( 'dashboard_incoming_links','dashboard', 'normal' );    //Incoming Links
      remove_meta_box( 'dashboard_plugins',       'dashboard', 'normal' );    //Plugins

}

Related