You can hook into the user_register
action hook and lower case the strings manually, by using the wp_update_user
function. Here’s a quick example:
add_action( 'user_register', 'callback_function', 10, 1 );
function callback_function( $user_id ) {
// Get the user by their ID
$user = get_user_by( 'id', $user_id );
// Update their user_login
wp_update_user(
array(
'ID' => $user_id,
'user_login' => strtolower( $user->user_login )
)
);
}
Using the pre_user_login
filter
You can use the above filter to filter the user’s login before its added to the database, as follows:
add_filter( 'pre_user_login', 'callback_function' );
function callback_function( $login ) {
return strtolower( $login );
}
Related Posts:
- Replacing the WordPress password validation
- WordPress auto login after registration not working
- Allow up to 5 Concurrent Login Sessions
- Why does is_user_logged_in() return false after redirect from another site?
- Pre-populate Username Field
- How to keep track of user logins?
- Get user info outside WordPress
- How can I secure a WordPress blog using OpenID from a single provider?
- Is it possible to get a user with just the password field?
- Redirect after login based on user role (custom login page)
- Check for user meta data at Login
- Redirect User to Homepage if no other redirect is specified
- My custom page template with is_user_logged_in() does not detect that I’m logged in
- Use phpbb user database for WordPress
- WordPress to use Drupal users’ credentials
- Share user table from WP with Drupal
- How can I allow password reset based on logins containing the @ character?
- A way to count logged in users and display count?
- stop login if user_status equal zero
- How do i make my wordpress website private?
- Redirect user to login before viewing custom post
- Max no of simultaneous active sessions for a single user
- When I try to login in wordpress it is showing “USER Doesn’t Exists”
- Should I encrypt the response that triggers an Ajax action? Is nonce sufficient?
- Redirect subscribers to last viewed page after log-in
- wordpress disable login for unverified user
- Reset Password policy
- Rewrite Rules and Login Issue
- Is possible to allow user to login with different role?
- Use WordPress Login for a non-wordpress site
- WordPress Login Customization for External Authentication
- Does wordpress support natively the concept of logging-in users? (not admins, but users of the website)
- Is there any action /filter hook I can use to disable login for some user role?
- How to check User Role and redirect to specific page according to Role when login in WordPress?
- Display video on homepage for users who have not logged in
- How do you manage your pages or functions that require logged-in users?
- How can i login with user’s password in WordPress being an admin?
- Delete a user from frontend
- Check if user is logged in via JS? [duplicate]
- Use members from 1 site on another one
- Can I edit the database to change a login?
- how redirect users to custom login page when “login to reply” is clicked? [duplicate]
- User(s) already exists show error please provide a valid username
- wp_generate_password sets password but can’t login using created password
- add class to element if user is not logged in [closed]
- Is there a way to call via javascript if a user is logged-in on a static html file?
- Restricting wordpress login sessions for a web app
- How to connect wordpress user with my own APP user?
- How to change default username field after login
- The same session information for peer users on two different WordPress servers
- WP users cant reset password
- Check for empty username or password on login
- $user_login is not working if author has only 1 post
- Specific Content on pages based on user
- user and usermeta table not found
- custom login form, guide me
- Changing user_login ends current session
- Current User Seeing Another Logged In User Info
- Redirect based on log-in status per JavaScript
- Securely log in a user without a password using a link?
- Integrating Facebook Registration (and Login) on a WordPress page
- WordPress – Security Question at Login from User’s Meta Data
- determine active user browser at the same time
- How to track all users logged into a site?
- Cant edit profile from frontend
- How to authenticate/verify login credentials & check for user meta without logging in?
- Ban a user and end their session
- How to let user set password on registration
- Copy a user from one WordPress site to another
- Count user posts by type and date
- How do I create a specific login page for a specific user?
- Is there a simple way to manage capabilities per user?
- Buddypress – Send New User Activation Link to Admin [closed]
- How to get current user’s phone number
- Front End Registration Form Code – Password Field Not Saving
- How do I customize the dashboard?
- Delete User via Frontend
- Limit a number of users returned from sorting users by latest posts function
- Will wordpress tools import do everything I need to copy one site to another
- How to notify specific users when i’m posting/modifying a new post
- User description only displayed for logged user
- Allow users to create post without logging in?
- WordPress Password security related questions
- Assign random (and unique) user meta upon registration
- Display the line breaks in user bio without using html
- Adding more fields to the add user page on dashboard
- Want to know who is login Admin/User
- Allow Weak Passwords
- Reading additional fields in PMPro
- How to put the ‘assign to new user’ select when you delete a user that has custom post type posts, but no normal posts
- How to make WordPress ‘editor’ role to list/view/add/edit users only with the role ‘author’?
- Query for post term that matches user ID
- User email verification without a plugin, is it possible?
- List users in a dropdown for login
- Add method for tracking who referred new users
- User count only for role frontend vendor
- Using and saving custom dropdown boxes on user profiles
- Giving users an editable homepage/business directory
- Buddypress – New user type with no profile and can’t interact but can be admin of a group
- Email Subscribe for Downloads in WordPress