Opened 7 days ago
Closed 6 days ago
#64261 closed defect (bug) (worksforme)
Suggestion: Apply trim() to Username Field During Login
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Login and Registration | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
Hi Team,
I would like to raise a small but important usability concern regarding the WordPress login process.
Currently, the username field in the login form does not automatically trim leading or trailing spaces. According to common coding standards and best practices, input trimming is recommended—especially for authentication fields—because users often enter accidental spaces on mobile or while copy–pasting.
As a result, even if the username and password are correct, the login attempt fails due to unintended whitespace. Implementing a simple trim() on the username field before validation would significantly improve user experience and reduce failed login attempts.
I kindly request the team to consider adding this enhancement in a future update.
Thank you for your attention and the great work you do for the community.
Change History (3)
#2
in reply to:
↑ 1
@
6 days ago
Replying to westonruter:
Thanks for checking this.
I tested it again on my side, and you’re right — the core WordPress login screen now trims the username automatically. Earlier, I was experiencing failed logins when accidental spaces were added, but it seems this behavior has been resolved in the current version.
It’s possible the issue was coming from a custom login form, plugin, or cached version of the login page on my setup.
Thank you for verifying and for the quick response.
@dishmaria Thanks for reporting this. I just tried to reproduce this issue and I wasn't able. In a WordPress install with username "admin", I tried providing " admin ", and it it still logged me in. Do you see differently?