3

For a specific use case, I need to add users only by username and email without having to input a password for them.

Right now if i try to leave the password field empty, it displays an error.

How can I create a new user without having to put password without modifying the core? is it possible to remove these fields from the user add form?

UPDATE: why do I need to do this?

referring to my other question here, the google authentication plugin checks (After successful google authentication) if the google email used is found in wordpress, for a given user.

So i just need to create users locally with their usernames and email only. I need to remove the password fields from the form and disable the built in login mechanism (but the latter is related to my other question mentioned above).

  • Please explain why you want to do it that way. It could be that you are facing a XY Problem. – kaiser Mar 13 '15 at 20:23
  • @kaiser you are right, check my update. – shadesco Mar 13 '15 at 20:26
  • How are you creating users? There are a few ways to create users: registration, wp-admin, network wp-admin, API. We setup our WP system to not use WP native auth either. – user42826 Mar 13 '15 at 20:33
  • @user42826 right now am adding them manually from wp-admin. However if you have a better method for this scenario am open to try it – shadesco Mar 13 '15 at 20:47
  • WP multiste allows admins to create users without a password. We wrote our own plugin to add multiple users (no password required). There are other plugins out there that will do the same thing. – user42826 Mar 14 '15 at 0:32
1

Current versions of WP allow creation of a user without creating a password. Just leave password area blank, and verify no password if prompted.

But, best practice might be to create user with a random password, but not tell the user the password. Have them do the 'lost password' thing to set up their own password. That's what I do for my users. I don't have to tell them a password (sending one via plaintext in an email is not good), and they are responsible for creating a password they can remember.

(Old question without an answer, but guidance is appropriate for current versions and anyone that finds the question.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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