Disabling the Lost or Changed Password Emails Function in WordPress

WordPress

When one of your WordPress users forgets their password or wants to have their password changed, there’s a link on the login page that allows them to do so.  The system will immediately send an email to the user with their information, but it will also email the admins that a user has reset their password.  If there are many users on the site, this means the admins may start to get more emails regarding passwords than they would really like.  Fortunately, there is a way to turn off the changed or lost password email alerts.

One of the first things you actually have to do is create a WordPress plugin that is specific to your site.  This plugin will let you add custom coding that will change and extend how WordPress functions and when certain code is loaded and run.  It can be used for many other things besides just stopping unwanted emails, of course.

Why is this necessary? In many cases, code such as this would be added to the functions.php file.  However, it will not work in this case because WordPress loads the theme file (functions.php) after it loads pluggable.php, the file that contains the code that automatically sends emails to admins when passwords are reset.  Since that code is loaded and executed first, any changes made to functions.php will not affect the password resets or emails.  That’s why a site-specific plugin has to be created.

To create this plugin, go to the /wp-content/plugins/ folder and create a yoursitename-plugin folder.  Then go into that folder and create yoursitename-plugin.php.  This is the file you will want to put your code into.  Add the following code to the file:

<?php

if (!function_exists (‘wp_password_change_notification’) ) {

function wp_password_change_notification() {}

}

?>

That’s all you need.  You can still add different code to the file if you want it to do anything else before or after this code, but it’s not necessary to stop these emails.

Once you’ve finished the plugin file, save it and upload it to the directory that you created.  Then you need to go to your plugins section and activate what you just uploaded.

This plugin will now prevent WordPress from sending any email notifications to the administrators when a user requests a lost password or changes their password.  Remember that this will stop all administrators from getting these emails – you cannot pick and choose who gets the emails.  It is either all admins or none of them.

There are other email notifications that WordPress sends.  For example, whenever a new user registered on your website, all administrators will get an email about it.  Turning this feature off is much easier than turning off the lost/change password feature.  All you need to do is download the Disable New User Notification Emails plugin from WordPress.org.  Install it and activate it.  That’s it – once it’s turned on, it will stop the system from sending you any emails regarding new user registrations.  You’ll still get all other emails, of course, and users will get email regarding their new username and password.

Share it!Share on FacebookTweet about this on TwitterShare on Google+Email this to someone

Our Recommended Wordpress Web Hosting Provider

WordPress

WHC.CA
Get a 50% Discount by using our link.

WHC.ca

Reliable host, with excellent customer service and an easy one-click Wordpress installation. Our recommendation to host a Wordpress blog.

Leave a Reply

Your email address will not be published. Required fields are marked *