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?

  • You could use the .htaccess file to deny access to that URL, or to redirect it to the homepage, etc. – Sally CJ Jun 11 '19 at 3:09

I'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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.