HOW TO: Disable ‘The site is experiencing technical difficulties’

As much as it’s helpful to be informed when something goes awry on your website, the last thing you need is to contact your clients each time you break the site.

WP 5.2 and beyond now sends out emails informing you ‘The site is experiencing technical difficulties’.

You can disable this but adding this to your wp-config:

define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );

or by adding this to theme functions:

add_filter( 'wp_fatal_error_handler_enabled', '__return_false' );