Support » Plugin: WP Password Generator » [Plugin: WP-Password Generator] New feature request

  • Resolved ronthai


    Would it be possible to have the option for the admin to choose the make up of the password? Now it is at random with #%$(&^)* and so on.

    I know that is to make the passwords strong, but it is also a pain in the B… for many of my members. Not everybody really knows how to simply copy and paste (yah, I could not believe it also).

    So an option to use only letters (small and capital) and numbers.
    And if possible avoiding iI1oO0, since depending on font used they also look many times the same.

    I know it is a really nonsence request, but my paying customers are complaining (well a few dumboos) and a password like Hyt53DExX97G4D3w is almost just as strong as hdt%34@CDf(7NJyg5

    Regards, Ron

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Steve Grunwell


    Hey ronthai,

    Previous versions of the plugin used a custom password generation function, but version 2.2 uses the built-in wp_generate_password() function. What’s neat about this is wp_generate_password() is a pluggable function, which makes it easy to overwrite the function with whatever you’d like. “Forgot Password” requests also use wp_generate_password(), so overriding the pluggable function in your theme ensures that user passwords are consistent.

    I’d recommend taking a look at the source (wp-includes/pluggable.php:1558). If you want to make any changes (or completely rewrite the function), simply create a wp_generate_password() function in your theme’s functions.php. For instance, you could drop in the following stripped down version (which removes special characters and iIlLoO0):

    function wp_generate_password( $length = 12 ) {
      $chars = 'abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ23456789';
      $password = '';
      for ( $i = 0; $i < $length; $i++ ) {
        $password .= substr($chars, wp_rand(0, strlen($chars) - 1), 1);
      // random_password filter was previously in random_password function which was deprecated
      return apply_filters('random_password', $password);

    Hope this helps,

    Thanks for that, works excellent and apparently a lot easier then I thought.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-Password Generator] New feature request’ is closed to new replies.