Remove meta boxes from wordpress admin panel dashboard

To remove the meta boxes from wordpress dashboard you have to use wp_dashboadrd_setup hook. The following snippet shows the function that removes the meta boxes on wordpress admin panel dashboard. You have to use remove_meta_box. In remove_meta_box the first argument is the ID of meta box you want to remove, which can be get by inspecting the element in firebug. Second parameter is the $page. In our case its dashboard. Other values are page, post. Third parameter is the $context, there are 3 values for it ‘normal’, ‘advanced’, or ‘side’. All three parameter are required.

function remove_dashboard_widgets() {
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // Incoming Links
remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // Plugins
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Quick Press
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); // Recent Drafts
remove_meta_box('dashboard_primary', 'dashboard', 'side'); // WordPress blog
remove_meta_box('dashboard_secondary', 'dashboard', 'side'); // Other WordPress News
remove_meta_box('wpdm_dashboard_widget', 'dashboard', 'normal'); // Right Now
remove_meta_box('dashboard_custom_feed', 'dashboard', 'normal'); // Latest from ButlerBlog
remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); // News and Updates
}

Lastly Add hook for removing the dashboard widgets.

add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s