首页 > 解决方案 > Wordpress - 在密码更改时禁用用户通知

问题描述

我们的客户希望禁用在有人使用“忘记密码”表单时发送 Wordpress 的默认通知电子邮件。

客户端使用的主题也会发送一封包含新密码的电子邮件,因此应禁用默认通知。

但是我不知道该怎么做,有人可以帮我吗?

问候

标签: wordpressemailnotificationsforgot-password

解决方案


Add this line to your function file to disable default password change notification in wordpress.

To disable the notice of changed email sent by the wp_update_user() function, simply use the filter hook to return false:

add_filter( 'send_email_change_email', '__return_false' );

Reference - https://codex.wordpress.org/Plugin_API/Filter_Reference/send_email_change_email

Method 2

if ( !function_exists( 'wp_password_change_notification' ) ) {
    function wp_password_change_notification() {}
}

put this code in your plugin file for method 2. Note - it will not work if you put in your theme function file

Reference - http://www.wpbeginner.com/wp-tutorials/how-to-disable-lostchanged-password-emails-in-wordpress/

Method 3 - use this plugin to get required output

https://wordpress.org/plugins/manage-notification-emails/


推荐阅读