Disable wordpress 4.3 send email when password is changed

Wordpress developers say: you can disable these emails through the send_pass_change_email and send_email_change_email filters by setting them to false.

I added these lines to my plugin, but this does not help:

function no_email_pass_change(){ return false; } add_filter( 'send_pass_change_email' , 'no_email_password_change'); function no_email_email_change(){ return false; } add_filter( 'send_email_change_email' , 'no_email_email_change'); function no_email_password_change(){ return false; } add_filter( 'wp_password_change_notification' , 'no_email_password_change'); 

Also I tried:

 add_filter( 'send_pass_change_email', '__return_false'); add_filter( 'send_email_change_email', '__return_false'); 

But nothing helps. It applies only to WP 4.3. What am I doing wrong?

+4
source share
2 answers

Use the following:

  add_filter( 'send_password_change_email', '__return_false'); 

They put the wrong description in the documentation.

+8
source

// Disabled sending emails when changing a password.

 add_filter( 'send_password_change_email', '__return_false' ); 

// Disabled sending emails when changing email.

 add_filter( 'send_email_change_email', '__return_false' ); 
+1
source

All Articles