0

When admin approves/unapproves a user, WordPress automatically sends an email about the change.

Here I want to PREVENT it, I DON'T want to send these emails, is there any snippet to add in functions.php file as I did it for not sending password change emails,

if ( is_admin() )
    add_filter( 'send_password_change_email', '__return_false' );
  • Aren't you using a plugin via which you approve/desapprove a registered user? – ClemC Aug 15 '17 at 15:35
  • am using a plugin 'Profile Builder' @ClemC – Mann Aug 15 '17 at 15:54
0

This should overwrite the plugable function that sends the email.

if ( !function_exists('wp_new_user_notification') ) {
    function wp_new_user_notification( $user_id, $plaintext_pass = '' ){}
}
  • Does it prevent emails when admin approves or disapproves a user account too? – Mann Aug 15 '17 at 15:31
  • How exactly are you approving or disaproving accounts? That's not a normal feature of WordPress. – Jim Maguire Aug 15 '17 at 15:34
  • am using a plugin 'profile builder' to do these, there is a module/addon 'User email customization' where I can customize the email, I disabled it. Now WordPress format emails are going. I need to stop these. @Jim Maguire – Mann Aug 15 '17 at 15:56
  • I tried your answer, it didn't work @Jim Maguire – Mann Aug 15 '17 at 16:04
  • Actually it does work, I tested it. You need to either disable whatever plugins you are using, or make the question about the plugin. – Jim Maguire Aug 15 '17 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.