Turning off new user notification in WordPress

September 17th, 2012 by Sean Barton Leave a reply »

I am not entirely sure why you would ever want to do this but I was asked this on the WordPress forums for my Welcome Email Editor plugin. Someone wanted to know if they can turn off the WordPress Welcome Email all together instead of sending one out by default.

Nice and simple really.. You just need to add this to a new plugin or to your theme functions.php file:

if (!function_exists('wp_new_user_notification')) {
 function wp_new_user_notification() {
    return false; 
 }
}

As ever you need to be careful of the plugin name.. WordPress plugins load in name order rather than with any priority. Due to the way in which the function is written it means it can only be declared once and it’s a race to get there as only the first one counts. This is why my Welcome Email Editor plugin works sometimes in conflicting environments when you call the directory a-welcome-email-editor. It then gets called first and then declared before some of the other plugins which might cause issues.

Leave a Reply