Admin – Dashboard – Unset recent comments


I try to get rid of the comments list in the WordPress 4 dashboard section but it doesn’t work.

Here is what I tried:

    function remove_all_dashboard_widgets() 
        global $wp_meta_boxes;

        // these 2 are ok as they are not displayed anymore

        // I tried both "recent" and "latest comments" with no success

        // I also tried these two with no success
        remove_meta_box('dashboard_recent_comments', 'dashboard', 'core');
        remove_meta_box('dashboard_latest_comments', 'dashboard', 'core');
    add_action('wp_dashboard_setup', 'remove_all_dashboard_widgets');

The Quick press and Primary boxes are unset, so it works but the recent comments remain on the screen.

The example above were tested at the same time. I tried one by one, but it doesn’t work

I also tried to hide the section with CSS by adding:

#latest_comments {display:none !important;}

But it still doesn’t work.

Any idea?

, , Baylock 5 years 0 Answers 82 views 0

Leave an answer