Disable WordPress 5.2 PHP error email

Maybe you developed a WordPress website years ago and today, years later, your client has started receiving emails that inform him of PHP errors. This is due to the new “site health” feature that, since WordPress version 5.2, sends an email every time a PHP error is detected.

If you want these emails not to be sent, or you want to receive them instead of the email address set as the main address in the WordPress admin, place these filters in the functions.php file of your theme or in your own plugin:

Disable WordPress PHP fatal error email sending:

I have not really seen a way to do it, but it is possible to modify the time lapse that must elapse between one email and another. So we can put an absurd figure and it is solved.


add_filter( 'recovery_mode_email_rate_limit', 'recovery_mail_infinite_rate_limit' );
function recovery_mail_infinite_rate_limit( $rate ) {
return 100 * YEAR_IN_SECONDS;
}

 

Change the recipient of the WordPress PHP fatal error email:

I think it’s the most useful. In this way you can get the mail to you instead of your client, and so the client is not scared and you are informed of the health of the site.


add_filter( 'recovery_mode_email', 'send_sumun_the_recovery_mode_email', 10, 2 );
function send_sumun_the_recovery_mode_email( $email, $url ) {
$email['to'] = 'your@email.com';
return $email;
}

Say Hello

Fray Luis Amigó 6, Oficina D
50006 Zaragoza

976 49 54 20

Si estás en ese momento en el que tienes una visión para tu empresa, eres lo suficientemente valiente como para querer llevarla a cabo, y no sabes cómo, ¡seguimos hablando!






    Basic information about the treatment of your data:

    • Responsible: Sumun Comunicación Global S.L.U. (Sumun)
    • Purpose: queries resolution (contact form) / application management (“work with us” form)
    • Legitimation: privacy policy consent by checking the box to the effect.
    • Recipient: Sumun. The data will not be transferred to third parties.
    • Your rights: access, rectify and delete data, portability of data, limitation or opposition to data treatment, transparency. lopd@sumun.net
    • Expiration: until the user announces that he wants to delete them, or failing that until Sumun considers that they are no longer useful.

    Horario de atención
    Lunes a vienes
    de 8:30h a 16:30h