Back to Blog
PHPPHPWordPressDevelopment

Disable All Mail for WordPress

I did this simple hack on a private WordPress Multisite blog, to stop it sending me emails every time I created a new blog.

1 min read
100 words
Disable All Mail for WordPress

I did this simple hack on a private WordPress Multisite blog, to stop it sending me emails every time I created a new blog. It's definitely overkill to stop all emails, but unfortunately I couldn't find any hooks that let me be more specific! (I didn't need any of the other emails – but you shouldn't use this code if you do!)

I put the code in wp-config.php. You could create a plugin instead, or putting it in your theme's functions.php might work (I haven't tested it).

// Disable ALL emails
function wp_mail()
{
    // Do nothing!
}