Answer to the Question
WordPress 6.5 offers no built‑in “silent alert” constant, but you can achieve the desired effect by manipulating the Site Health API through hooks. The three key filters are:
site_status_tests – modify the list of tests that run.
site_status_test_results – alter the result of a completed test.
site_status_email_notifications – control which alerts trigger e‑mail.
To keep critical alerts while silencing the rest, create a small plugin that:
- removes non‑critical tests from the
site_status_tests array, or
- forces a
PASS status on selected non‑critical tests via site_status_test_results, and
- returns an empty array from
site_status_email_notifications so only critical failures can trigger e‑mail (or adjust the recipients list if you still want to receive alerts for certain checks).
There is no constant that selectively disables only non‑critical checks. The only constant that turns the entire Site Health module off is DISABLE_SITE_HEALTH. WP_DEBUG and related constants do not influence Site Health notifications.
Programmatic Approach
Below is a minimal plugin skeleton that demonstrates the three steps. Replace the NON_CRITICAL_TESTS array with the slugs of the checks you want to silence.
$group ) {
foreach ( $group as $slug => $test ) {
if ( in_array( $slug, NON_CRITICAL_TESTS, true ) ) {
// Keep the test; otherwise remove it.
unset( $tests[ $category ][ $slug ] );
}
}
}
return $tests;
} );
// 3. Force PASS on the remaining non‑critical tests after they run.
add_filter( 'site_status_test_results', function( $results ) {
foreach ( $results as $slug => $result ) {
if ( in_array( $slug, NON_CRITICAL_TESTS, true ) ) {
$result['status'] = 'pass';
$results[ $slug ] = $result;
}
}
return $results;
} );
// 4. Suppress email notifications for non‑critical alerts.
add_filter( 'site_status_email_notifications', function( $notifications ) {
// Returning an empty array stops all Site Health emails.
// If you still want critical alerts, rebuild the array with only critical slugs.
return array();
} );
?>
Verification Checklist
- Activate the plugin via the admin dashboard.
- Trigger a known non‑critical issue (e.g., install a plugin that adds a warning).
- Check
Tools > Site Health: the warning should no longer appear.
- Trigger a critical issue (e.g., delete a core file) and confirm that the dashboard still flags it.
- Verify that no e‑mail is sent for the non‑critical test, but a critical failure still results in an e‑mail if you modify the
site_status_email_notifications filter accordingly.
What If I Need More Granularity?
WordPress does not provide per‑alert thresholds. The only control is the status field returned by each test: critical, recommended, or pass. If you need finer control, you must implement custom tests or extend existing ones with additional logic.
Missing Diagnostic Detail
Which non‑critical checks are causing the most noise in your environment? Knowing the exact slugs will let you target them precisely in the NON_CRITICAL_TESTS array above.