Stop WordPress from sending any emails. ANY!
Stop a WordPress website from sending any emails using the standard wp_mail() function. No emails will be sent, not even for password resets or administrator notifications.
WordPress websites can send emails for a variety of reasons — e.g user registration, password reset, enquiry form submission, e-commerce purchase — but sometimes you don’t want it to send anything at all. Some reasons for disabling all emails:
NB: if you need to run this plugin on WordPress 5.4 or earlier, and must install manually from a .zip file, please install version 1.6.3 which you can download from the Advanced page for the plugin. Since version 1.7.0, WordPress 5.5 or later is required.
Many thanks to the generous efforts of our translators:
If you’d like to help out by translating this plugin, please sign up for an account and dig in.
You probably have another plugin that adds its own implementation of the wp_mail()
function. Try disabling some plugins.
In some circumstances, enabling the must-use plugin from settings will fix this, because must-use plugins load before other plugins.
You probably have a plugin that is sending emails via some other method, like directly using the PHP mail()
function, or directly implementing an SMTP client. Not much I can do about that…
The plugin replaces the standard WordPress wp_mail()
function with a function that sends no emails. Nada. Zip. Silence.
Behind the scenes, it creates a private copy of PHPMailer and allows the system to interact with it, but silently suppresses the functions that send emails. The standard WordPress filter and action hooks are supported, so plugins that register hooks for those will still function as normal. It just doesn’t actually send any emails.
Yes. Once you have activated the plugin, navigate to Settings > Disable Emails and click the “Activate must-use plugin”. This will create a must-use plugin (mu-plugin) that ensures that Disable Emails is always loaded. This can be especially useful on development websites where the database is frequently refreshed from a live site which does not have Disable Emails activated.
NB: if you activate the must-use plugin on a multisite, it will stop emails on all sites on the multisite! If you have multiple networks on your multisite, the must-use plugin will stop emails on all networks.
The full changelog can be found on GitHub. Recent entries:
Released 2023-11-22