The default WordPress behavior of sending the admin notification emails when users reset their password can become annoying fast.
The only way to disable these notifications is by adding this piece of code to your child theme’s functions.php, or create a custom functionality plugin.
<?php
add_action('init',function(){
remove_action( 'after_password_reset', 'wp_password_change_notification' );
});
If you need to add a code snippet to WordPress, editing your theme’s functions.php, or creating a custom plugin can break your site, and adds a lot of unnecessary overhead.
You actually aren’t supposed to add code to your theme’s functions.php, because if your theme updates, you will lose all your changes. The correct way to do this is by creating a child theme.
Both routes require a lot of boilerplate code, and you will end up with a long, messy, and hard to maintain file (be it functions.php or a custom plugin)
The code snippet to disable password reset notifications is present on the WPCodeBox WordPress Snippet Repository. To add this snippet to your WordPress site, you would just need to install WPCodeBox, open the Code Snippet Repository, download the snippet and enable it.
The other great thing about WPCodeBox is that it allows saving great snippets to the cloud so you can share them across all your WordPress sites. So no more looking for that perfect snippet. When you need it, you will have it saved to your cloud account and ready to be downloaded.
You can see how easy WPCodeBox makes it to customize your site without having to mess with custom plugins or adding code to your theme’s functions.php. WPCodeBox is the easiest and safest way to add Code Snippets to your WordPress site.