WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Tutorials» How to Disable Lost/Changed Password Emails in WordPress

How to Disable Lost/Changed Password Emails in WordPress

Last updated on November 12th, 2014 by Editorial Staff
17 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
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 email notifications in WordPress? By default, WordPress automatically sends email notification to admins when any other user resets their password using the lost password link. These emails can become 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.

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 the functionality of WordPress on your site. We have detailed instructions on why and how to create a site-specific WordPress plugin.

Once you have created your site specific WordPress plugin, then you 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 your site-specific plugin.

That’s all. WordPress will stop sending you email notifications whenever a user changes their password.

Let us explain the code to you. WordPress has a built-in function wp_password_change_notification located in /wp-includes/pluggable.php file. 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, it instructs WordPress to do nothing.

You might be wondering why not paste this code in your theme’s functions.php file?

Because it won’t work. WordPress loads pluggable.php file before your theme’s functions.php file, so you cannot override the functions defined in pluggable.php in your theme’s functions.php file. That’s why you need to paste this code in 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 turn off comment notifications in WordPress.

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

17 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Start Your Own Podcast (Step by Step)

    How to Start Your Own Podcast (Step by Step)

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Google Analytics in WordPress

    How to Install Google Analytics in WordPress for Beginners

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

18 Comments

Leave a Reply
  1. Ali Jooyafar says:
    Mar 4, 2021 at 5:29 am

    Thank You So much because of your useful tutorial.
    a WP User From Iran. <3

    Reply
    • WPBeginner Support says:
      Mar 4, 2021 at 10:59 am

      Glad our guide was helpful :)

      Reply
  2. David says:
    Oct 10, 2020 at 10:07 am

    Hello Good day wpbeginners, I tried using code snippet plugin, then placing the codes but I get an error saying
    “The snippet has been deactivated due to an error on line 3: Cannot redeclare function wp_password_change_notification”.

    Please I need a solution to this. Thanks

    Reply
    • WPBeginner Support says:
      Oct 12, 2020 at 10:47 am

      For the method in this article, you would need to add it as a custom plugin and not using an additional plugin for it to work.

      Reply
  3. Marc says:
    May 5, 2020 at 5:08 pm

    Thank you so much, so many emails and thus energy wasted nowadays, that could be saved with 3 lines of code.. thank you!!

    Reply
    • WPBeginner Support says:
      May 6, 2020 at 10:21 am

      Glad our guide was helpful, while not the solution for every site we’re glad this could be something useful to you :)

      Reply
  4. Christopher Simmons says:
    Jun 21, 2018 at 1:55 pm

    Thanks for this, was resetting some of my author passwords simply for security, and they started complaining why they were getting emails about it when they no longer write for my publication — doh. This would have helped there, and now it’s in place in our “extension plugin” we put all our hacks into. :-)

    THANK YOU!

    Reply
  5. ronald says:
    Aug 29, 2016 at 3:25 am

    Thanks for this code it helps me and my admin.

    Reply
  6. Marie Jac says:
    Jul 14, 2016 at 4:36 am

    Hi!

    I am trying to remove the notification sent to the user himself when reset his password (because an email is already sent by another customer plugin). The code above seems to only remove notification to admin. Is there another code I can use?

    Thank you!!

    Reply
  7. Guido says:
    May 2, 2016 at 7:24 pm

    There is an hook for that.
    Simply add this line of code

    remove_action( 'after_password_reset', 'wp_password_change_notification' );

    Reply
  8. Fábio Tojal says:
    Mar 24, 2016 at 1:01 pm

    Hi there,

    I am having problem! When I click on Reset Password nothing Happens! It stays in the same page!

    Do you know what is happenig ?

    Thanks!

    Reply
  9. Steve Barman says:
    Mar 16, 2016 at 10:14 am

    The plugin generated 4 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin. – I hope this isn’t anything to worry about

    Reply
    • WPBeginner Support says:
      Mar 16, 2016 at 9:33 pm

      If you continue to see this message, then please inform the plugin author.

      Reply
  10. John Dough says:
    Mar 2, 2016 at 1:33 am

    Another option is to filter all emails from change password to the trash. In GMail you can setup a filter by opening the email and then somewhere along the top is a list of options. One is filter messages like these. Follow the onscreen instructions and send them to the trash.

    Reply
  11. Bajza Ferenc says:
    Jun 12, 2015 at 11:24 am

    Hi,

    I found better solution for solve this problem without plugin.

    Backup your wp-includes/pluggable.php
    Edit wp-includes/pluggable.php file
    Find wp_password_change_notification part
    Delete these lines from file:

    if ( !function_exists(‘wp_password_change_notification’) ) :
    /**
    * Notify the blog admin of a user changing password, normally via email.
    *
    * @since 2.7.0
    *
    * @param object $user User Object
    */
    function wp_password_change_notification(&$user) {
    // send a copy of password change notification to the admin
    // but check to see if it’s the admin whose password we’re changing, and skip this
    if ( 0 !== strcasecmp( $user->user_email, get_option( ‘admin_email’ ) ) ) {
    $message = sprintf(__(‘Password Lost and Changed for user: %s’), $user->user_login) . “\r\n”;
    // The blogname option is escaped with esc_html on the way into the database in sanitize_option
    // we want to reverse this for the plain text arena of emails.
    $blogname = wp_specialchars_decode(get_option(‘blogname’), ENT_QUOTES);
    wp_mail(get_option(‘admin_email’), sprintf(__(‘[%s] Password Lost/Changed’), $blogname), $message);
    }
    }
    endif;

    Save.

    Enjoy.

    Reply
    • WPBeginner Support says:
      Jun 12, 2015 at 6:00 pm

      We strongly advise our users, to NEVER edit core WordPress files.

      Reply
    • Alvaro says:
      May 6, 2016 at 10:24 am

      NEVER, NEVER, NEVER edit WordPress core files.

      Any change should be done through a plugin or a child theme.

      Reply
  12. Pam Blizzard says:
    Nov 12, 2014 at 12:31 pm

    Exactly what I wanted to know – and I thought putting a snippet in functions.php was the best way to go, but I’m so glad you mentioned that it wouldn’t work. THANK YOU!

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
SeedProd Logo
SeedProd
Create beautiful custom landing pages - Drag & drop builder. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2021 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2021)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2021)
    • SiteGround Reviews from 4464 Users & Our Experts (2021)
    • Bluehost Review from Real Users + Performance Stats (2021)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2021 – Step by Step Guide
Deals & Coupons (view all)
Elegant Themes
Elegant Themes Deal
Get the Divi theme with 194+ template packs from Elegant Themes for only $89. Extra, Bloom, and Monarch included free!
Liquid Web
Liquid Web Coupon
Get 50% OFF on Liquid Web managed WordPress hosting plans for 3 months. From just $9.50.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).

Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
  • Growth Fund
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon
  • AIOSEO

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress Security by Sucuri.