Home / admin / Disable dashboard widgets
  • How to Disable dashboard widgets

    no thumbnail sorry: Disable dashboard widgets

    Adding this first block of code to the functions.php of your wordpress theme will disable select widgets within your dashboard. Bellow is a list of widgets you can add to the list if you wish to disable them.

    ( click code to copy )

    wordpress snippet : PHP

    <>
    function remove_dashboard_widgets() {
     global $wp_meta_boxes;
     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
    }
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );
    
    ( click code to copy )

    wordpress snippet : PHP - list of widgets

    <>
     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
     unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
     unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
    

    ( WordPress codex functions, hooks, in this snippet. )

    wp_meta, add_action, wp,
  • zeb

    Hi, thanks for this snippet. :)Wondering if there is any way to disable the screen uptions for non admins and  not just hiding it?