How to Remove WordPress Dashboard Widgets (also from screen options)

If you login to your wordpress admin area ,you will see some useful (or maybe useless) dashboard widgets. It is a useful feature in single author blogs. By default,you can  turn off any dashboard widget using the “Screen Options” tab at the right top of the admin area. In multi-author blogs it leak some important details to other users. Example:incoming links,recent coments, right now, recent drafts etc.

To completely remove wordpress dashboard widgets (Dashboard quickpress widget,incoming links widget,Recent comments widget,Right Now widget,Dashboard Plugins widget,Dashboard Recent Drafts widget,Dashboard primary widget,Dashboard secoundary widget)

Always Backup Before You Change Anything

Add the below code inbetween the <?php  ?> tag in your dashboard.php file.Example:

<?php your code here ?>

replace “your code here” with the below code. Default path for dashboard.php file

// Create the function to use in the action hook

function example_remove_dashboard_widgets() {
// Globalize the metaboxes array, this holds all the widgets for wp-admin

global $wp_meta_boxes;

// Remove the Dashboard quickpress widget


// Remove the Dashboard  incoming links widget


// Remove the Dashboard Recent comments widget


// Remove the Dashboard Right Now widget


// Remove the Dashboard Plugins widget


// Remove the Dashboard Recent Drafts widget


// Remove the Dashboard primary widget


// Remove the Dashboard secoundary widget



// Hook into the 'wp_dashboard_setup' action to register our function

add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );


Also Read:  How to Limit Failed Login Attempt Attacks in WordPress

If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.

Leave a Reply