Since WordPress 5.2 there is an automated E-Mail on PHP exceptions. In some smaller projects I just upload the files for new extensions while developing - whenever an error occurs then, the site admin is getting an email. This is usually one of my freelance customers and they unecessarily panic then.

Therefore I would like to turn of this email notifications (without changing the admin email). Is there some kind of action/filter, config option (e.g. define) to disable this behaviour? Some true/false option would be the best? Then I can disable this just for the times I develop.

  • Do you only want to disable the email notification? If not, setting WP_DISABLE_FATAL_ERROR_HANDLER should deactivate the whole thing – kero Jul 5 '19 at 15:56
  • @kero It would be better to only disable the email notification. I do not know exactly what the error handler does, therefore I am not sure if it is a good idea to disable it completely. – Blackbam Jul 5 '19 at 16:01

There was some discussion on it a few weeks ago you can find here: https://make.wordpress.org/core/2019/04/16/fatal-error-recovery-mode-in-5-2/

According to that and looking through the core, you can accomplish that with one of two methods:

define('RECOVERY_MODE_EMAIL', 'foo@bar.com');


add_filter( 'recovery_mode_email', 'recovery_email_update', 10, 2 );
  function recovery_email_update( $email, $url ) {
    $email['to'] = 'foo@bar.com';
    return $email;

Hope that helps!!

| improve this answer | |

I have thoroughly tested the above suggestions and neither of them work.

The only thing I have found that DOES work is adding the following to "wp-config.php":


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