How to Stop WordPress From Sending Emails

WordPress doesn’t send out too many emails. They’re usually only generated for an important notice, or when an action is required on your part. However, there are a few different circumstances under which you may not want WordPress to send any emails.

For example, when working on a development site, or even a production site, you may inadvertently trigger emails that send to real users when testing or making changes.

The best developers are able to stay invisible. Ideally, you don’t want any users to know or suspect that you are working on the site, so it’s important to suppress emails that might be triggered by your work. Fortunately, there are two plugins that will do this for you automatically.

Stop Emails

The Stop Emails plugin, created by Sal Ferrarello, works silently to prevent any outgoing emails from being sent using wp_mail() function. WordPress will continue to act normally, as if the emails were sent successfully.

When the plugin is active, you’ll see a notice in the admin area to remind you that emails are not currently being sent.

Stop Emails also has a filter that you can use, which will allow you to log emails and send the information to the php_error.log:

[php]add_filter(‘fe_stop_emails_log_email’, ‘__return_true’);[/php]

Disable Emails

Disable Emails is a similar plugin, created by WordPress plugin developer Ross McKay. It stops any and all emails, using the standard wp_mail() function by replacing it with an empty function. Disable Emails is different in that it is totally silent and does not show an admin notice to remind you that emails are stopped.

It also has a more explanatory readme.txt file that cites several scenarios wherein you might consider shutting WordPress emails off:

Demonstration websites that allow users to do things that normally send emails

Development / test websites with live data that might email real customers

Bulk-loading data into websites which might trigger emails

Adding new sites into multisite installations

Both of these plugins are aimed at developers who probably want to turn emails off temporarily or only on a development site. You could also use the plugin to create a totally silent WordPress site that never sends out any notifications, although this is probably not recommended.

Email notifications are still one of the easiest ways to keep your finger on the pulse of your website when you don’t visit every day. If you opt to use one of these plugins temporarily on a live site, it’s important to remember to turn the plugin off when you’re finished working.