Family Encyclopedia >> Electronics

How to disable lost/changed password emails in WordPress

Recently, one of our users asked if there was a way to disable lost/changed password notifications in WordPress. By default, WordPress automatically sends an email notification to administrators when any other user resets their password using the lost password link. These emails can get annoying if you are running a site with many users. In this article, we will show you how to disable lost/changed password email notifications in WordPress.

The first thing you need to do is create a site-specific WordPress plugin. A site-specific WordPress plugin allows you to add any custom code to change or extend WordPress functionality on your site. We have detailed instructions on why and how to create a site-specific WordPress plugin.

Once you have created the specific WordPress plugin for your site, you will need to add these two lines to your plugin.

 if (! function_exists ('wp_password_change_notification')) function wp_password_change_notification () 

Save your changes and then activate the plugin specific to your site.

That is all. WordPress will stop sending you email notifications every time a user changes their password.

Let us explain the code to you. WordPress has a built-in function wp_password_change_notification located at /wp-includes/pluggable.php proceedings. That function is responsible for sending those email notifications when a user resets their password.

These two lines of code override the built-in function and instead of sending an email, tell WordPress to do nothing.

You may be wondering why not paste this code into your theme's functions.php file?

Because it won't work. WordPress loads the pluggable.php file before your theme's functions.php file, so you cannot override functions defined in pluggable.php in your theme's functions.php file. This is why you need to paste this code into a site specific plugin.

We hope this article helped you disable password change email notifications on your multi-user WordPress site. You may also want to take a look at how to disable new user email notifications, or how to disable comment notifications in WordPress.

If you enjoyed this article, please subscribe to our WordPress YouTube Channel video tutorials. You can also find us on Twitter and Google.+.