Make WordPress Core

Opened 3 years ago

Last modified 18 hours ago

#45359 new enhancement

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

Reported by: 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!

Change History (4)

#1 @BjornW
3 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
7 weeks ago

I am using https://wordpress.org/plugins/disable-password-change-email 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.

18 hours 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: https://core.trac.wordpress.org/ticket/45359

#4 @Mte90
18 hours 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.

Note: See TracTickets for help on using tickets.