Remove the suggested password in WordPress

Remove the suggested password in WordPress on your child site.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'random_password', 'disable_suggested_password', 10, 2 );

function disable_suggested_password( $password ) {
    $action = isset( $_GET['action'] ) ? $_GET['action'] : '';
    if ( 'wp-login.php' === $GLOBALS['pagenow'] && ( 'rp' == $action  || 'resetpass' == $action ) ) {
        return '';
    }
    return $password;
}
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.