Change the recovery mode email address to which the fatal error emails are sent to, instead of bothering and potentially confusing the site admin.
If you wish to send those fatal error recovery mode emails to someone other than the site administrator there is a filter for it.
Concerned site owner
A few weeks ago I was working on a client’s staging site. I had a typo in some new code that caused a 500 error. Due to the fatal error protection feature added in WordPress 5.2 I saw the “There has been a critical error on your website. Please check your site admin email inbox for instructions.” message and it sent an email to the site admin. Unfortunately the site admin was the site owner.
I fixed the error immediately but got a concerned email from the site owner the next day.
In order to avoid creating such concern I want to change the address that the email is sent to, without changing the site admin email address.
I searched around WordPress core code and found the function that creates and sends the email. This lead me to search the web for the ‘recovery_mode_email‘ filter and the first user contributed note shows how to change the email address – thanks Ulrich. Another note says that the code cannot be placed in the theme’s functions.php file and must be in a separate plugin and that is what the code below is.
Leave a Reply