[wp-trac] [WordPress Trac] #64261: Suggestion: Apply trim() to Username Field During Login

WordPress Trac noreply at wordpress.org
Mon Nov 17 06:29:07 UTC 2025


#64261: Suggestion: Apply trim() to Username Field During Login
------------------------------------+-----------------------------
 Reporter:  dishmaria               |      Owner:  (none)
     Type:  defect (bug)            |     Status:  assigned
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Login and Registration  |    Version:
 Severity:  normal                  |   Keywords:
  Focuses:                          |
------------------------------------+-----------------------------
 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64261>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list