1

I need to change/generate passwords for the registered users, but should not send an email to them regarding this. Admin will tell the password to them later.

these members are registered on the old site, and I just migrated to the new site which is developed in WordPress, so we need these people to log in after new site launch so admin gives the password to them and they can change later.

However, these are unapproved users. Do email for password change goes even for unapproved users? How to prevent sending an email to the users?

1

See 'send_password_change_email' filter hook.
It is part of the wp_update_user() function, fired on admin or on frontend... So I think you can check if the update is done via the admin, then if true, deactivate the email this way...

if ( is_admin() )
    add_filter( 'send_password_change_email', '__return_false' );
  • yeah, will add this functions.php. correct? @ClemC – Mann Aug 15 '17 at 8:26
  • @Mann, you can try... – ClemC Aug 15 '17 at 8:34
  • is there a similar snippet for admin approval, that means, that means when admin approves user account an email should not be sent. Am using 'Profile Builder' plugin. It sends these mails, approved mails – Mann Aug 15 '17 at 12:51

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.