WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

is there a way to shorten the length of the 'auto generated password' which is sent during registration of a new user?

I would like to shorten this password to 5 characters max and also remove the numbers '0' and '1' as they can be confused for letters 'O' and 'L'.

My users are not very tech savvy and most don't know how to copy and paste a password. They type each character instead which can be time consuming and frustrating at the same time which is why I am looking to shorten the password.

My wordpress version is: 3.5.1

share|improve this question
up vote 2 down vote accepted

Use the random_password hook. It will trigger on new registrations once a random password has been generated.

add_filter('random_password', 'modify_the_pass');

function modify_the_pass($pass) {
    $pass = substr($pass, 0, 6); // make $pass six characters
    return $pass; // return our new $pass
share|improve this answer
Thank you so much, works perfectly! – theshorttree Apr 1 '13 at 14:14
@theshorttree Great, you can perhaps mark this answer as accepted then. – montrealist Apr 1 '13 at 14:32
done! thanks again! – theshorttree Apr 3 '13 at 20:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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