Disable emails for new user registration


I want to disable the default email that is send when user is registered.
I am using this plugin for email verification User Verification
By PickPlugins
, which sends an email with confirmation link, but the problem is that by default and WordPress send an email via pluggable.php:

function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ){...}

I am using a theme (which I am extending with a child theme), which calls wp_create_user. I have replaced that parent theme function and in my functions.php I have added:

add_action( 'init', function(){
    remove_action( 'register_new_user',   'wp_send_new_user_notifications'         

add_action(    'register_new_user',   'wpse236122_send_new_user_notifications' );

function wpse236122_send_new_user_notifications(  $user_id, $notify = 'user' ){
    wp_send_new_user_notifications( $user_id, $notify  );

The problem is, it still send both emails, from the plugin and default WordPress email for new user registration. I don’t know how to disable this email.

, , gdfgdfg 4 years 2019-02-05T17:03:20-05:00 0 Answers 91 views 0

Leave an answer