Every time I go to my Gmail inbox I’ve got dozens and dozens of new joiners on my Buddypress site – some people would say that’s great and it is. But I keep having to delete all the so-and-so would like to join mysite.com emails. So – is there any way to stop the email I get every time someone joins my Buddypress site? Well it just so happens there is.
How to turn off email notification when new users join your WordPress site
The bad news is – there isn’t a way to stop the administrator getting emails when a new user signs up to your WordPress site – I guess the programmers said – would would you NOT want t o be notified? Well one obvious reason is that many WordPress sites are deluged by spam – and there are ways to stop spammers signing up and we’ll look at that in another article.
The good news is, I searched around the web and found some good ways to do this. It so happens there is a way to do it using a plugin WP Mail SMTP – this has been explained well here >>
The other way to do this is using code added as a snippet (get a snippet plugin like this one or this one – they’re brilliant!) or add it to your functions.php file – always backup files first (**we don’t suggest editing any functions.php file directly because even the tiniest mistake in the code can render your site inaccessible. The simplest way to add custom code in WordPress without breaking your site is with the free WPCode plugin. It’s the most popular code snippet plugin used by 2 million+ WordPress website owners – below the code is a way to add this below code without editing the functions file directly**);
<?php
function
wpcode_send_new_user_notifications(
$user_id
,
$notify
=
'user'
) {
if
(
empty
(
$notify
) ||
'admin'
===
$notify
) {
return
;
}
elseif
(
'both'
===
$notify
) {
// Send new users the email but not the admin.
$notify
=
'user'
;
}
wp_send_new_user_notifications(
$user_id
,
$notify
);
}
add_action(
'init'
,
function
() {
// Disable default email notifications.
remove_action(
'register_new_user'
,
'wp_send_new_user_notifications'
);
remove_action(
'edit_user_created_user'
,
'wp_send_new_user_notifications'
);
// Replace with custom function that only sends to user.
add_action(
'register_new_user'
,
'wpcode_send_new_user_notifications'
);
add_action(
'edit_user_created_user'
,
'wpcode_send_new_user_notifications'
, 10, 2 );
}
);
The easiest way to add customized code snippets like the one above into WordPress without breaking your website is with WPCode plugin. It’s totally FREE and the most popular code snippets plugin used by 2 million+ WordPress websites.
First, install and activate the WPCode plugin in WordPress. Now, in the WordPress site admin area go to Code Snippets » + Add Snippet. There you’ll see a code snippet library to select snippets that have various functionality from. Guess what?.. WPCode plugin has a ready-to-go out-of-the-box solution in the form of a template to disable new user notification emails! All you need to do is type ‘user’ in the search area then click ‘Use snippet’ under ‘Disable New User Notifications’ snippet! Done.
This page is about: stop emailing Administrator every time a person joins my WordPress or Buddypress site | how to disable email sent to Admin when a new user joins my WordPress site