Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

When we login to wordpress admin area that time we first saw the admin dashboard. Many tabs and section are not useful in admin dashboard section for wordpress admin and sometimes we don’t know what is that sections.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

We saw the right now, recent comments, quick press, stat, recent drafts, incoming links, wordpress development blog, other wordpress news, plugins and more sections in wordpress dashboard section. Most of that section are not useful to wordpress admin. So is that better to remove unwanted section from dashboard.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme
Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

For disable the dashboard section we are going to use the wp_dashboard_setup method. In wordpress dashboard there are multiple meta boxes listed. some of them as follows:

//Main column
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']

//Side Column
$wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']
$wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']

For removing the widgets or meta boxes from dashboard you need to open your functions.php file from wordpress theme folder and put following code in that file.

function remove_dashboard_meta_boxes(){
  global$wp_meta_boxes;
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
  unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
  unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

add_action('wp_dashboard_setup', 'remove_dashboard_meta_boxes')

This code will remove the incoming link, right now, plugins, recent comments and secondary section from wordpress dashboard section.

Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme
Remove Unwanted Meta Boxes from wordpress dashboard through wordpress theme

If you want the more information about wordpress dashboard widget then check following URL
http://codex.wordpress.org/Dashboard_Widgets_API

If you are having any issue or questions about wordpress dashboard then please write to me.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.