How can we disable wp_generate_password function in wordpress?

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

how can we disable wp_generate_password function

Related posts

2 comments

  1. 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;
    }
    
  2. 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.

Comments are closed.