Last active
October 19, 2024 14:14
-
-
Save finalwebsites/83d70fa7f4ba53b1377ac34d7e613ce1 to your computer and use it in GitHub Desktop.
WordPress: Disable dashboard widgets, like new & events or quick press
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add this code to the functions.php file from your chilc theme | |
add_action('wp_dashboard_setup', 'fws_remove_dashboard_widgets', 100); | |
function fws_remove_dashboard_widgets(){ | |
remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Quick draft | |
remove_meta_box('dashboard_primary', 'dashboard', 'side'); // WordPress Events and News | |
remove_meta_box('dashboard_activity', 'dashboard', 'side'); // Activity | |
remove_meta_box('dashboard_site_health', 'dashboard', 'side'); //Site Health Status | |
remove_meta_box('dashboard_right_now', 'dashboard', 'side'); // At a Glance | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspect the code from your WP dashboard to find the hooks from other widgets (added by plugins or themes).
For example:
remove_meta_box('e-dashboard-overview', 'dashboard', 'side');
for the Elementor widget.