Opens in a new tab

Remove WordPress site health dashboard and menu item

You can remove the WordPress site health dashboard widget and menu item with the following snippets

Remove Site Health Dashboard Widget

add_action('wp_dashboard_setup', 'themeprefix_remove_dashboard_widget' );
/**
 *  Remove Site Health Dashboard Widget
 *
 */
function themeprefix_remove_dashboard_widget() {
    remove_meta_box( 'dashboard_site_health', 'dashboard', 'normal' );
}

Remove Site Health Menu Item

add_action( 'admin_menu', 'remove_site_health_menu' );	
/**
 * Remove Site Health Sub Menu Item
 */
function remove_site_health_menu(){
  remove_submenu_page( 'tools.php','site-health.php' ); 
}

Disable Site Health Email Notifications

In wp-config.php set the constant…

define( 'WP_DISABLE_FATAL_ERROR_HANDLING', true );

or in functions.php

add_filter( 'wp_fatal_error_handler_enabled', '__return_false' );

Categorised

2 comments

Leave your comment