Make WordPress Core

Opened 6 years ago

Last modified 16 months ago

#45359 new enhancement

Add checkbox to enable or disable sending out emails on password changes from backend

Reported by: atz's profile atz Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9.8
Component: Users Keywords: has-patch 2nd-opinion needs-copy-review
Focuses: Cc:


Could we please add a checkbox on the user backend, that will toggle the sending of emails when something is changed in the backend, eg. and most important, the password?

It is a huge mistake trigger when developing sites or debugging staging/live sites with users or customers.

A little checkbox below the password field to stop WP from sending out a notification would be so great!

Attachments (1)

2187.diff (1.7 KB) - added by Mte90 21 months ago.
adding the patch from GH to track on My patches on Trac

Download all attachments as: .zip

Change History (8)

#1 @BjornW
6 years ago

Hi @atz,

I (maybe wrongfully) assume WordPress will not add a setting to enable/disable sending out emails, but I do have a possible solution to share which I often use myself.

A possible solution while developing or debugging is using PHP's send_mail option in the PHP.ini. You can set it to use a shell script which can concatenate the outgoing mails into a logfile instead of sending them for real.

Assuming you are using linux here's how to do this: ($ = your terminal prompt)

  • open a terminal
  • $ echo "cat >> /tmp/emails-sent.log" > /usr/local/bin/logmail
  • $ chmod +x /usr/local/bin/logmail
  • In your php.ini set: sendmail_path=/usr/local/bin/logmail

Depending on your PHP and webserver settings you need to reload / restart them to make sure the sendmail_path has been updated correctly.

This will concatenate all emails into one file found in /tmp and called emails-sent.log which can be tailed with the command-line application tail. Hope this helps.

#2 @Mte90
2 years ago

I am using and installing right now in 5 different websites to disable to receive those emails.

I was thinking that an option in General Settings is the right place for that.
I will try to look to do a patch when I have time.

This ticket was mentioned in PR #2187 on WordPress/wordpress-develop by Mte90.

2 years ago

  • Keywords has-patch added

Disable the email notification when an user change the password to the admin with the settings in the General Settings page.

Probably need a better wording.

Trac ticket:

#4 @Mte90
2 years ago

  • Keywords 2nd-opinion needs-copy-review added

PR done, maybe the flow can be different with not adding the action at all instead of not enqueing the hook.

My primary doubts are on the wording and on the setting in the General settings page.

21 months ago

adding the patch from GH to track on My patches on Trac

#5 @audrasjb
16 months ago

Hi there,

Honestly, I think it is plugin’s territory. It's better to leave it to plugin, to avoid ending up with a ton of settings in options-general :)

#6 @Mte90
16 months ago

A hook can be a solution, so plugins can implement it, but I get as admin various emails from different websites that I manage just for support.

Those are ecommerce, events tickets sellers and so on, so to just get the email important for an admin like when there is a crash I used a filter in my inbox.

This means that all the plugins that suggest registering a new user should have an option for this and this means fragmentation and uncertain support to avoid those emails.

#7 @Mte90
16 months ago

Just to add more information, talking with @audrasjb it is the case to do another PR with just a filter to let plugins handle that.

This because the plugin is a workaround that just the subject of any email sent on wordpress, and it isn't something that is good after all.

I will see to do that (if someone else wants to do it there isn't a problem) but in my opinion it is something that should be in the WordPress settings.

Note: See TracTickets for help on using tickets.