Setting the Recovery Mode Email on Your Child Site

Recovery Mode Email on Your Child Site

Heads up: This page may include affiliate links. Read the full disclosure.

WordPress 5.2 introduced a fatal error recovery mode. A fatal error on a site would have normally resulted in a white screen of death, where the front-end of the site is white and would be the result of a fatal error conflict being caused by the active theme or one of the active plugins. The fatal error would have caused the sites wp-admin not be loadable.

In WordPress 5.2, when a fatal error is detected, an email is sent to the admin email address listed on the site, but there is a constant that can be set in the child sites to use a specific email address to set the fatal error email to.

MainWP has the amazing code snippets extension, which can be used to set code snippets on all connected child sites.

The code snippet to set on the child sites would be;

define( 'RECOVERY_MODE_EMAIL', 'user@sitedomain.com' );

Remember to change the example email address with the actual email address that you would want to use.

There is also a filter in WordPress core, now to set the recovery email address as well. The example code is;

add_filter( 'recovery_mode_email', function( $email_data ) {
    $email_data['to'] = 'user@sitedomain.com';
    return $email_data;
});

Remember to change the example email address to the actual email address you want to use. With the correct email address set for the recovery email, you will be notified if one of the connected child sites has a fatal error, then you can take action to fix the issue on that specific site.

4 thoughts on “Setting the Recovery Mode Email on Your Child Site”

  1. Thanks for the helpful reminder to set this notification for client sites to go to our support inbox!

    You can also modify the email message with the recovery_email_support_info filter: https://developer.wordpress.org/reference/hooks/recovery_email_support_info/

    Or disable the error handling entirely with:
    define( ‘WP_DISABLE_FATAL_ERROR_HANDLER’, true );

Comments are closed.

Looking for something?

Privacy laws apply to businesses that collect personal information. Since no personal information is collected by the MainWP plugins, no privacy laws apply to the MainWP plugins. This includes GDPR, UK DPA 2018, PIPEDA, Australia Privacy Act 1988, LGPD, PIPL, and other privacy laws.
Donata Stroink-Skillrud
Donata Stroink-Skillrud
President of Agency Attorneys

Your Download Is Just One Click Away

…or just download the plugin.

By entering your email, you agree to our Terms of Service and Privacy Policy.