Skip to content

Instantly share code, notes, and snippets.

@wujekbogdan
Last active August 29, 2015 14:06
Show Gist options
  • Save wujekbogdan/67cdd643d32cca4ec860 to your computer and use it in GitHub Desktop.
Save wujekbogdan/67cdd643d32cca4ec860 to your computer and use it in GitHub Desktop.
Remove default WordPress Dashboard widgets (WordPress 4.0)
function mytheme_remove_dashboard_widgets()
{
$widgets = array(
'dashboard_incoming_links' => 'normal',
'dashboard_right_now' => 'normal',
'dashboard_plugins' => 'normal',
'dashboard_recent_comments' => 'normal',
'dashboard_activity' => 'normal',
'dashboard_quick_press' => 'side',
'dashboard_primary' => 'side',
'dashboard_secondary' => 'side',
'dashboard_recent_drafts' => 'side',
);
foreach ($widgets as $id => $context) {
remove_meta_box($id, 'dashboard', $context);
}
}
add_action('wp_dashboard_setup', 'mytheme_remove_dashboard_widgets');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment