Opened 4 years ago
Last modified 10 months ago
#8296 new enhancement
Auto generate password for new user
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Users | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | cnorris23+wordpress@…, bill.erickson@…, brad@…, aaroncampbell |
Description
It would be nice to have a button that generates a random password to use when you're creating a new user account in the admin section
Attachments (4)
Change History (25)
comment:1
jamierumbelow — 4 years ago
- Owner changed from anonymous to jamierumbelow
- Component changed from Administration to Users
comment:7
johnbillion — 2 years ago
Related: #9210
solarissmoke — 2 years ago
comment:8
solarissmoke — 2 years ago
- Keywords has-patch added; needs-patch removed
Patch adds a "generate random password" button to the add user section.
It uses ajax to call wp_generate_password(). We could quite easily generate a password with JS only, but I figured that we should allow the filter in wp_generate_password() to be applied. Open to other opinions however.
comment:9
solarissmoke — 2 years ago
PS I haven't added the password generator to user-edit.php on the basis that you would typically want something random only when it is going to be emailed to the user for first use.
Adding a random password generator to user-edit.php feels like asking for trouble, because you just know someone will hit "update" without taking note of the random password.
comment:10
nacin — 2 years ago
#9210 has a JS version of wp_generate_password() from sivel.
comment:11
follow-up:
↓ 16
westi — 2 years ago
Why not just have a check box to send a random password to the user - no need for js or anything?
comment:12
solarissmoke — 2 years ago
- Keywords has-patch removed
That makes sense. Would it be going too far to just remove the manual password altogether and force a random password?
comment:13
aaroncampbell — 2 years ago
I'd be happy with "Leave blank to have a password randomly generated" although that doesn't make a lot of sense unless you've also checked the box to "Send this password to the new user by email."
comment:14
billerickson — 21 months ago
- Cc bill.erickson@… added
comment:15
williamsba1 — 10 months ago
- Cc brad@… added
comment:16
in reply to:
↑ 11
ericlewis — 10 months ago
Replying to westi:
Why not just have a check box to send a random password to the user - no need for js or anything?
Is there a large enough user population that has JS disabled, so things like this should be baked into PHP where possible?
The JS fix seems like it would fit in best as far as UX goes.
Updated version of solarissmoke's implementation, as the current doesn't apply cleanly. Remove AJAX dependency.
comment:17
aaroncampbell — 10 months ago
- Cc aaroncampbell added
I definitely like the first patch better (even if it needs a refresh). Using wp_generate_password() which allows filtering makes this more useful (especially on enterprise sites with specific password requirements)
SergeyBiryukov — 10 months ago
SergeyBiryukov — 10 months ago
8296.2.diff is the refreshed AJAX implementation. "Send this password to the new user by email" is checked automatically when the button is pressed.
Screenshot: 8296.2.png
comment:19
williamsba1 — 10 months ago
I'd love a way to see the password that was generated. There are many occasions when I'm creating accounts for users and I need a record of the password on their account.
comment:20
billerickson — 10 months ago
+1 to Brad's comment. Having the ability to view the randomly generated password when created is definitely useful.
When I send a site to a client for review, I create their user, give it a random password, and email their login information along with a lot of other information.
comment:21
williamsba1 — 10 months ago
A good UI example of this is the cPanel password generator. A simple lightbox opens when you click to generate a password shown here:
http://docs.cpanel.net/twiki/bin/view/11_30/CpanelDocs/PasswordGenerator

Good idea - I'll write a patch.