Overriding Recovery Emails in WordPress 5.2

WordPress 5.2 introduced recovery mode which allows site owners to access their WordPress backend in situations which previously crashed the website and required a developer. This is an amazing new feature. 👏

This works by hunting for PHP fatal errors and sending email notification to the WordPress admin email when found. The first week after updating all my customers to WordPress 5.2 I received about a dozen or so emails like so.

Most of these weren’t critical but helpful to know something needed to be corrected. By default these notifications go to the admin email which means many of my customers also started to receive them. While that makes sense for most situations, I’d rather receive these emails and deal with the errors myself. Luckily this is easily configurable by defining RECOVERY_MODE_EMAIL in wp-config.php. With WP-CLI this can easily be set by running the following.

wp config set RECOVERY_MODE_EMAIL <email-address>