• Hello!

    I found this page: https://www.ads-software.com/support/topic/set-a-default-password/

    But I wasn’t able to re-open that thread to get more help… Sorry for reposting… a bit of a newb here.

    Anyways, I’m hoping to use the plugin WP Code Snippets to have all new users have a set/default password that I choose… For example “pass123” something like that.

    I tried the code as provided on the other thread by wasn’t able to make it work. I’m not sure if the WP password generator that comes stock with WP is overriding this function… but basically when a new user is created I’d like for them to be given a set password that I choose. Please help. Thank you developers for your time/attention.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    ?I’m hoping to use the plugin WP Code Snippets to have all new users have a set/default password that I choose… For example “pass123”?

    That seems like an absolutely terrible idea. But if you insist on basically giving up on security, then why not just paste the password into the password field when you create a user?

    Thread Starter beauman1234

    (@beauman1234)

    Fair.

    However, I’ve set up my site so that only people who have purchased a product are the ones that will have a new user role created. All other avenues have been disabled/redirected.

    Furthermore, any new user that’s created is only a “subscriber” which inherently won’t have the ability to do much on my site in a malicious way.

    However, if I’m wrong in the above, please feel free to educate me. But I’ve taken some good measures to be sure that only ppl who have bought something will be created as a new user.

    Yes, I know worst case scenario, someone buys something, then they share their username and generic password with a bunch of people, but I feel this is pretty unlikely. EVEN IF this were to happen there’s options for disabling multiple logins from the same user acct.

    About your suggestion of pasting the password into the password field… Im actually looking for a way that a standard/generic password will be automatically created by WP so that when the standard WP email is sent to the new user, it has that set password.

    Open to ideas/help on the matter.

    Thanks again!

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If your users have the same password, and that user’s purchases are stored and visible to the user, then anyone who knows another user’s ID (which is not protected, so easily knowable) will have access to their account.

    Thread Starter beauman1234

    (@beauman1234)

    Fair point.

    However in my case all billing is handled through a 3rd party that the user must go into their email to access their billing info, not via my site.

    Moderator bcworkz

    (@bcworkz)

    Instead of sending a default password in an email, why not use the default WP new user email message that provides a link where users would set their own password? Assigning a password for someone else is just a bad idea and entirely unnecessary.

    If you insist on setting a default password, you could use the “user_register” action hook to modify the user’s record in the DB. Use wp_hash_password() to create a hash of the password which can be saved in the “user_pass” field of the user’s DB record. FWIW, you could instead simply store a normal MD5 hash and WP will update it to its PasswordHash scheme on first access.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Create Standard Password For New User’ is closed to new replies.