With WP 5.2 now shipping with the "Site Health" page, I'd like to be able to disable this feature -- it shows way too much about the server info.
To remove it from the menu I'm using:
function escode_remove_site_health_feature() {
remove_submenu_page( 'tools.php', 'site-health.php' );
}
add_action( 'admin_menu', 'escode_remove_site_health_feature' );
This works well for removing the page from the admin menu. Now I'd like to disable access to the actual page.
My initial go-to was to check if ('site-health' === $screen->id), and then redirect that to the homepage. It feels a bit hacky though -- is there a more professional approach?
With WP 5.2 now shipping with the "Site Health" page, I'd like to be able to disable this feature -- it shows way too much about the server info.
To remove it from the menu I'm using:
function escode_remove_site_health_feature() {
remove_submenu_page( 'tools.php', 'site-health.php' );
}
add_action( 'admin_menu', 'escode_remove_site_health_feature' );
This works well for removing the page from the admin menu. Now I'd like to disable access to the actual page.
My initial go-to was to check if ('site-health' === $screen->id), and then redirect that to the homepage. It feels a bit hacky though -- is there a more professional approach?
Share Improve this question asked Jun 10, 2019 at 20:59 Best Dev TutorialsBest Dev Tutorials 4451 gold badge7 silver badges21 bronze badges 1 |1 Answer
Reset to default 1I'm not sure if this is what you're looking for, but defining WP_DISABLE_FATAL_ERROR_HANDLER
to true
will disable the site health check entirely according to a post about site health check features in 5.1.
.htaccess
file to deny access to that URL, or to redirect it to the homepage, etc. – Sally CJ Commented Jun 11, 2019 at 3:09