If your WordPress site has many users, you’ve probably seen these new emails for user registration quite a bit.
Getting emails when a new user signs up on your site is really useful. But if you’re getting these emails every day because lots of users are joining, you might want to stop them.
If you don’t want anyone to be able to sign up on your WordPress site, you can turn off this option. Go to “Settings” and then “General” in the admin dashboard. You’ll see a box that says “anyone can register.” If you uncheck it, no new users can sign up on your site.
But if you still want users to join your site, and you only want to stop getting those email alerts, this article is for you. Today, I’ll show you two ways to stop getting emails when new users sign up on WordPress.
Disable New User Notification Emails using a WordPress Plugin
The simplest way to stop getting emails about new users in WordPress is by using a plugin called “Manage Notification E-mails.” This plugin helps you turn off many different types of emails that the admin gets.
Once you’ve added and turned on the plugin, you’ll see a new choice in your settings called “Notification e-mails.” Here, you can control lots of email settings for your WordPress site.
Even though this plugin can help you stop emails for things like changing passwords, notifying users, and recovering forgotten passwords, we’re focusing on the main one for admins.
All you need to do is uncheck the box that says “New user notification to admin.” This will stop those emails you get when new users sign up on your WordPress site.
Code Snippet to Disable New User Emails in WordPress (Disable New User Notification Email in WordPress programmatically)
If you don’t want to use a plugin, you can use this special code made with PHP.
Put this code piece into your theme’s “functions.php” file or use a tool like the Code Snippets plugin.
By doing this, you won’t get those “New User Registration” emails to your admin email anymore. But, if your site doesn’t get too many new users, it’s a good idea to keep these emails on. That way, you’ll know if there’s suddenly a lot of new sign-ups.
<?php //Disable the new user notification sent to the site admin function diwakaracademy_disable_new_user_notifications() { //Remove original use created emails remove_action( 'register_new_user', 'wp_send_new_user_notifications' ); remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 ); //Add new function to take over email creation add_action( 'register_new_user', 'diwakaracademy_send_new_user_notifications' ); add_action( 'edit_user_created_user', 'diwakaracademy_send_new_user_notifications', 10, 2 ); } function diwakaracademy_wp_send_new_user_notifications( $user_id, $notify = 'user' ) { if ( empty($notify) || $notify == 'admin' ) { return; }elseif( $notify == 'both' ){ //Only send the new user their email, not the admin $notify = 'user'; } wp_send_new_user_notifications( $user_id, $notify ); } add_action( 'init', 'diwakaracademy_disable_new_user_notifications' );
Related Articles
Leave a Reply