functions
-
Hi, would it be possible to add function that will turn off notifications to admin when customer resets password etc?
-
Hi, and thanks for the suggestion, it’s a good one.
Custom SMTP currently focuses on the sending path and the log, so it doesn’t have switches for WordPress’s own automatic emails yet. You can turn those two admin notifications off today with two lines, in your theme’s
functions.phpor a small mu-plugin (the Code Snippets plugin works too if you’d rather not edit files):// Stop the email sent to the admin when a user resets their password
remove_action( 'after_password_reset', 'wp_password_change_notification' );
// Stop the email sent to the admin when a new user registers (WordPress 6.1+)
add_filter( 'wp_send_new_user_notification_to_admin', '__return_false' );If the “etc.” covers other automatic emails (new user, updates, comment moderation…), tell me which ones and I’ll post the matching lines.
I’m also adding a “Manage notifications” screen to the roadmap: a list of WordPress’s automatic emails with simple on/off toggles, so none of this needs code. I’ll follow up in this thread when it ships.
Thanks,
NicolasHi,
This shipped in 2.7.0, out today.
You will find it under Settings → Custom SMTP → WordPress Notifications. Each email WordPress sends on its own now has its own checkbox:
- Password reset notice to the administrator, the one you asked about
- New user registered notice to the administrator
- Automatic update reports, separately for core, plugins and themes
- Comment awaiting moderation
- New comment to the post author
A few things worth knowing. Nothing is switched off by default, so updating the plugin will not silence anything your site is already sending. A notification you switch off is never created at all, which means it will not appear in the Email Logs either, and the screen says so to save you looking for it. And the emails your users need to keep control of their account, the reset link itself and the address change confirmation, are deliberately out of reach: no settings screen should be able to break account recovery.
The two snippets I posted earlier still work if you would rather keep it in code, the checkboxes just do the same thing without the file editing.
Thanks again for the suggestion, it was a good one. Feel free to mark this resolved if it does what you needed.
Nicolas
Thank you. I have set not to receive notifications about pasword reset, and after couple days I received this notification, that some customer reseted password. SO I assume it does not work?
You must be logged in to reply to this topic.