Providing a valid email address is a mandatory step in installing WordPress. On the email address of the admin user wine Password reset messages, Site health And messages then When visitors leave comments. For many reasons, however, you want to know how to turn off email messages in WordPress. The main reason being the spam messages or even worse the vulnerability of a plugin that exploits the function wp_mail()
and sends spam messages to tens of thousands of addresses.
Most WordPress spam messages are sent through PHPMailer when one form is vulnerable or when a plugin allows third -scripts PHP to use wp_mail()
.
If you have a blog or site on WordPress and it is not necessary for the system to send email messages to administrator or users, then the best solution is to disable the WordPress email function.

Before following the steps in the tutorial below, keep in mind that this method will completely deactivate the WordPress email system. No email messages will be sent to reset password, messages when the site encounters functionality problems or when users comment on the blog. If you use modules like contact form, set them to not send email messages via PHPMailer.
- How to reset the WordPress user administrator user, without access to email or database - Reset WordPress Administrator Password
- How to clean huge wp_options in SQL – Transients, wpseo_sitemap _cache_validator
- Fix WordPress “Briefly unavailable for scheduled maintenance. Check back in a minute.”
- Cum debifam implicit “Ship to different address” din pagina de Checkout a Woocommerce
How do you disable sending email messages to WordPress
This method does not require the installation of a plugin. All you have to do is edit the functions.php file of the active basis on the blog and add the following code lines:
add_filter('pre_wp_mail', 'sth_disable_emails');
function sth_disable_emails() {
return false;
}
Save the change. That's all.