Disable email notification after change of password

I want to disable the email notification if a user or an admin changes the password of a user.

After some Googling I came to find that I need to create a plugin and overwrite the wp_password_change_notification function found in pluggable.php.

This is the plugin and function:

<?php
/*
Plugin Name: Stop email change password
Description: Whatever
*/

if ( !function_exists( 'wp_password_change_notification' ) ) {
    function wp_password_change_notification() {}
}
?>

I uploaded the file to my plugin folder and activated it in my admin panel!

This needs to be done with a plugin because the pluggable.php file is loaded before the functions.php file.

Anyway it doesn’t seem to work for me.

The user still receives the email.

I disabled all plugins and run the plugin on a clean install so no interference

The WP_DEBUG doesn’t show any errors as well!

Can anybody tell me what to change or how to fix it any other way (except core modifications :-))

M.

9

To disable user email notification, add this in a plugin or theme:

add_filter( 'send_password_change_email', '__return_false' );

FYI wp_password_change_notification() controls admin email notification when a user changes their password

Leave a Comment