禁止修改密码
class Password_Reset_Removed
{

    public function __construct()
    {
        add_filter('show_password_fields', array($this, 'disable'));
        add_filter('allow_password_reset', array($this, 'disable'));
        add_filter('gettext', array($this, 'remove'));
    }

    public function disable()
    {
        if (is_admin()) {
            $userdata = wp_get_current_user();
            $user = new WP_User($userdata->ID);
            if (!empty($user->roles) && is_array($user->roles) && $user->roles[0] == 'administrator') {
                return true;
            }

        }
        return false;
    }

    public function remove($text)
    {
        return str_replace(array('Lost your password?', 'Lost your password', '忘记密码?'), '', trim($text, '?'));
    }
}

$pass_reset_removed = new Password_Reset_Removed();
修改密码页面重定向至首页
function OPE_disable_lost_password()
{
    if (isset($_GET['action'])) {
        if (in_array($_GET['action'], array('lostpassword', 'retrievepassword'))) {
            wp_redirect(home_url(), 301);
            exit;
        }
    }
}
add_action("login_init", "OPE_disable_lost_password");