Are you bothered by your WordPress site regularly sending email notifications about newly registered user accounts? Instead of spending time managing these notifications, learn how to disable new user notification emails in WordPress with the method shared in this article by We. This solution will help you optimize your inbox and focus on more important tasks.
Benefits of Disabling New User Notification Emails
- Minimize the number of notification emails: Instead of receiving emails for each new user who signs up, you can selectively or completely eliminate them.
- Optimize your inbox: Your inbox will be cleaner and easier to manage, allowing you to save time and focus on other important emails.
- Improve work efficiency: Processing registration notification emails will no longer be a burden, enabling you to spend more time on your primary tasks.
Stop Annoying New User Emails in WordPress (Easy Steps!)
Step 1: Add custom code to functions.php
First, open the functions.php file of the WordPress theme you are using. Then, copy and paste the code below at the end of the file:
function disable_new_user_notifications() {
remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications' );
add_action( 'register_new_user', 'send_new_email_notifications' );
add_action( 'edit_user_created_user', 'send_new_email_notifications', 10, 2 );
}
function send_new_email_notifications( $user_id, $notify = 'user' ) {
if ( empty($notify) || $notify == 'admin' ) {
return;
} elseif( $notify == 'both' ){
$notify = 'user';
}
wp_send_new_user_notifications( $user_id, $notify );
}
add_action( 'init', 'disable_new_user_notifications' );
function custom_wp_new_user_notification_email( $wp_new_user_notification_email, $user, $blogname ) {
$subject = sprintf( '[%s] - Registration Info - [We Solution]', $user->user_login );
$headers = "Content-Type: text/plain\r\n";
$wp_new_user_notification_email['subject'] = $subject;
$wp_new_user_notification_email['headers'] = $headers;
return $wp_new_user_notification_email;
}
add_filter( 'wp_new_user_notification_email', 'custom_wp_new_user_notification_email', 10, 3 );
Step 2: Save and test functionality
After adding the code to functions.php, save the file and try registering a new account. Now, when a new user signs up, you will no longer receive notification emails!
By employing this approach to disable email notifications when users register for an account in WordPress, you can redirect your focus to more critical tasks, free from the distraction of unwanted email notifications. Give it a try and experience the convenience firsthand!