Title: changing password length
Last modified: August 30, 2016

---

# changing password length

 *  Resolved [dbvisel](https://wordpress.org/support/users/dbvisel/)
 * (@dbvisel)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/)
 * Hi!
 * I’m working for a site that doesn’t want 32-character passwords; so in edd-auto-
   register.php, I changed this line:
 * `'user_pass' => wp_generate_password( 32, false),`
 * to 10 characters. Obviously I don’t like messing with plugins! Is there a way
   that I can stick this code in my own plugin?
 * Thanks! Really happy with this plugin in general.
    Dan
 * [https://wordpress.org/plugins/edd-auto-register/](https://wordpress.org/plugins/edd-auto-register/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Andrew Munro / AffiliateWP](https://wordpress.org/support/users/sumobi/)
 * (@sumobi)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621524)
 * Yes you can, are you familiar with how to use a filter?
 * [https://github.com/easydigitaldownloads/edd-auto-register/blob/master/edd-auto-register.php#L303](https://github.com/easydigitaldownloads/edd-auto-register/blob/master/edd-auto-register.php#L303)
 * Here’s a great post on using them:
    [https://pippinsplugins.com/a-quick-introduction-to-using-filters/](https://pippinsplugins.com/a-quick-introduction-to-using-filters/)
 *  Thread Starter [dbvisel](https://wordpress.org/support/users/dbvisel/)
 * (@dbvisel)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621525)
 * Thanks! That looks like it will work for me.
 *  Plugin Author [Andrew Munro / AffiliateWP](https://wordpress.org/support/users/sumobi/)
 * (@sumobi)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621529)
 * You’re welcome!
 *  Thread Starter [dbvisel](https://wordpress.org/support/users/dbvisel/)
 * (@dbvisel)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621535)
 * Hi! Here’s what I added to my private plugin:
 *     ```
       function edd_auto_register_insert_user_args($user_args) {
       	$myargs = array('user_pass' => wp_generate_password( 10 )	);
       	$user_args = array_replace($user_args, $myargs);
       	return $user_args;
       }
       add_filter( 'maybe_insert_user', 'edd_auto_register_insert_user_args');
       ```
   
 * That’s not working. Can I ask what I’m doing wrong?
 *  Plugin Author [Andrew Munro / AffiliateWP](https://wordpress.org/support/users/sumobi/)
 * (@sumobi)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621541)
 * Try this:
 *     ```
       function edd_auto_register_change_user_pass( $args ) {
   
           $args['user_pass'] = wp_generate_password( 10 );
   
           return $args;
        }
        add_filter( 'edd_auto_register_insert_user_args', 'edd_auto_register_change_user_pass' );
       ```
   
 *  Thread Starter [dbvisel](https://wordpress.org/support/users/dbvisel/)
 * (@dbvisel)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621542)
 * That works! Thanks so much for your prompt reply!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘changing password length’ is closed to new replies.

 * ![](https://ps.w.org/edd-auto-register/assets/icon-256x256.png?rev=2718121)
 * [EDD Auto Register](https://wordpress.org/plugins/edd-auto-register/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/edd-auto-register/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/edd-auto-register/)
 * [Active Topics](https://wordpress.org/support/plugin/edd-auto-register/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/edd-auto-register/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/edd-auto-register/reviews/)

## Tags

 * [length](https://wordpress.org/support/topic-tag/length/)
 * [password](https://wordpress.org/support/topic-tag/password/)

 * 6 replies
 * 2 participants
 * Last reply from: [dbvisel](https://wordpress.org/support/users/dbvisel/)
 * Last activity: [10 years, 10 months ago](https://wordpress.org/support/topic/changing-password-length/#post-6621542)
 * Status: resolved