admin管理员组文章数量:1323342
WordPress 5.4 introduced the Site Health Status dashboard widget (source).
The dashboard widget shows the status of the site health check:
How can I remove the Site Health Status dashboard widget?
WordPress 5.4 introduced the Site Health Status dashboard widget (source).
The dashboard widget shows the status of the site health check:
How can I remove the Site Health Status dashboard widget?
Share Improve this question edited Apr 2, 2020 at 18:23 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Apr 2, 2020 at 9:12 SvenSven 3,6841 gold badge35 silver badges48 bronze badges4 Answers
Reset to default 9The following snippet removes the registered site health dashboard widget from the dashboard. Add the code to your plugin or functions.php
file:
add_action('wp_dashboard_setup', 'remove_site_health_dashboard_widget');
function remove_site_health_dashboard_widget()
{
remove_meta_box('dashboard_site_health', 'dashboard', 'normal');
}
Log in to your Dashboard. On the screen showing the "Site Health" widget, click the "Screen Options" menu item at the top right of your screen and turn off "Site Health" and any other widgets you don't want to see.
Each time you login the Site Health functions will not appear. This is a per user function, therefore turning it off only removes it for you and not other users.
Putting this in your functions.php
will remove Site Health widget from the dashboard:
add_action( 'wp_dashboard_setup', 'remove_site_health_widget' );
function remove_site_health_widget() {
global $wp_meta_boxes;
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_site_health'] );
}
And this will remove the respective option from the menu:
add_action( 'admin_menu', 'remove_site_health_submenu', 999 );
function remove_site_health_submenu() {
$page = remove_submenu_page( 'tools.php', 'site-health.php' );
}
I don't believe that removing Site Health altogether is advisable, though, as it is a nice feature that can help you fix problems that might otherwise be undetected. What I suggest, instead, is hiding it from everyone except for the main Admin.
I created a free, lightweight, plugin to solve this issue
https://wordpress/plugins/remove-site-heath-from-dashboard/
本文标签: wp adminHow to remove the site health dashboard widget
版权声明:本文标题:wp admin - How to remove the site health dashboard widget? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742134601a2422313.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论