I would like to turn off the emails that the admin gets when a new user registers. We are getting a lot of emails because of new registrations (they are legitimate registrations) but I just don't want to see the email telling me that someone has signed up again and again.
So far I've tried installing plugins but they don't work. (support even says they don't work any longer). When searching around here the only question I was able to find was Turn off admin emails for new user registrations which is from three years ago and doesn't seem to work either. I tried with this code:
// Redefine user notification function
if ( !function_exists('wp_new_user_notification') ) {
function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
$message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "rnrn";
$message .= sprintf(__('Username: %s'), $user_login) . "rnrn";
$message .= sprintf(__('E-mail: %s'), $user_email) . "rn";
// @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);
if ( empty($plaintext_pass) )
return;
$message = __('Hi there,') . "rnrn";
$message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "rnrn";
$message .= wp_login_url() . "rn";
$message .= sprintf(__('Username: %s'), $user_login) . "rn";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "rnrn";
$message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "rnrn";
$message .= __('Adios!');
wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
}
}
to my theme functions.php (it has the line @wp_mail commented out) and I've even tried to comment out that line in wp-includes/pluggable.php
but I still am getting the emails.
I'm using WordPress 4.5.3 right now. (UPDATED to 4.6 as part of this process)
I'm trying to be a clear as a can. I don't want the email that goes to the user to stop as they still should get that, but how can I make the email to admin stop?