7

Is there a way to disable random password generation in Word press ?

how can we disable wp_generate_password function

6
  • Why you want to disable this function Commented Mar 31, 2016 at 9:11
  • 1
    @deemi I want my users to choose their own password Commented Mar 31, 2016 at 9:14
  • WordPress never generate auto password .... it gives us option for own password Commented Mar 31, 2016 at 9:22
  • @deemi Yes it is generating. And I dont know how. Please help me Commented Mar 31, 2016 at 9:24
  • @deemi Random password is generated when clicked on password reset link ,not on register page Commented Mar 31, 2016 at 9:31

2 Answers 2

6

For inexperienced users can be annoying/confusing to see auto-generated password on first screen. Add the following code to the wp-content/themes/your_current_theme/functions.php to disable this function.

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

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

It is very easy to disable auto generated passwords.

1). follow the path WooCommerce -> Settings -> Account & Privacy

2). remove checks in account creation section (shown in the picture) screenshot

3). save changes.

Not the answer you're looking for? Browse other questions tagged or ask your own question.