admin menu - Disable new Site Health screen safely?

With WP 5.2 now shipping with the "Site Health" page, I'd like to be able to disable this feature -- it s

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
  • You could use the .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
Add a comment  | 

1 Answer 1

Reset to default 1

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745416242a4626761.html

相关推荐

  • admin menu - Disable new Site Health screen safely?

    With WP 5.2 now shipping with the "Site Health" page, I'd like to be able to disable this feature -- it s

    15小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信