Try hooking in as soon as the user is created or updated.
<?php
function wpse_250785_sync_user_login_with_email($user_id) {
$user = new WP_User($user_id);
if ($user->user_login != $user->user_email) {
$user->user_login = $user->user_email;
wp_update_user($user);
}
}
add_action('user_register', 'wpse_250785_sync_user_login_with_email');
add_action('profile_update', 'wpse_250785_sync_user_login_with_email');
Disclaimer: Untested, but should work 😉
Related Posts:
- Custom user roles are unable to login
- Can I programmatically login a user without a password?
- What is $interim_login?
- Adding extra authentication field in login page
- What exactly is ReAuth?
- Login members using web services
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to pass users back and forth using session data?
- Website Visible only to Registered users
- Need to execute a cron job
- moving server can not login
- Validate Custom Login field
- Calling wp_signon doesn’t log the user in
- How to implement Google reCaptcha without installing a plugin?
- How can I allow access to two user accounts using one login?
- Is it possible a one click user registration with Facebook or Twitter (or other Social Networks)?
- Are there ways of logging in that bypass wp-login.php altogether?
- Redirecting or displaying a message on first login
- How to display username and password after registration
- Password protect media attachment – share across guests
- WordPress login problem
- Two factor authentication
- How to generate “WP_Error” Object for user login?
- WordPress Login redirection according to user role
- How do you manage your pages or functions that require logged-in users?
- How to restrict access to a single for users I’ve authorized? [closed]
- Allow Access to Home Page and Login Screen but Nothing Else (unless logged in)
- Where is the php file, that does the checks for login information?
- I want login using email not username wordpress front end
- Reloading page with a query string upon login for admins
- Sign in with social media accounts without creating a WP account [closed]
- WordPress authentication using custom php?
- authenticate user without redirecting
- Multiple issues with Ajax login function due to browsers and cookies
- How to post frontend login form to a different authentication script from wp-login?
- Using WordPress login for a non word-press website
- Extend Cookie with auth_cookie_expiration not working
- Can we start session from another php site to wordpress blog site?
- How to password protect pages in WordPress
- How to lock WordPress front-end with login and password?
- Opening protected page with cookie?
- Handle POST request sent from an external site for login?
- External Authentication
- Creating Custom Login Form Where Password Field is Dropdown Menu
- Login and register by API
- In Django, how do I know the currently logged-in user?
- Can’t log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
- Is there any way to rename or hide wp-login.php?
- How to login with email only no username?
- How can I redirect user after entering wrong password?
- Increase of failed login attempts, brute force attacks? [closed]
- Login page ERROR: Cookies are blocked due to unexpected output
- Separate registration and login for different roles
- SSO / authentication integration with external ‘directory service’
- Preventing session timeout
- How reduce wordpress login session timeout time?
- How to prefill WordPress registration with social details
- Check for correct username on custom login form
- How to Change the Default Home Page for the WordPress Dashboard?
- Disallow user from editing their own profile information
- I can’t access my site via wp-admin
- ‘Password field is empty’ error when using autofill in Chrome
- Removing username from the ‘wordpress_logged_in’ cookie
- How to show ‘login error’ and ‘lost password’ on my template page?
- How do I require authorization / login to view a specific set of posts / pages?
- Custom login form
- How to prefill the username/password fields on the login page
- wp_signon returns user, but the user is not logged in
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
- wp_signon() does not authenticate user guidance needed
- What are the differences between wp_users and wp_usermeta tables?
- WordPress auto login after registration not working
- Make my wordpress blog remember my login “forever”
- How to check in timber if user is loggedin?
- How do I change the language of only the login page?
- Stop WordPress from logging me out (need to keep me logged in)
- Woocommerce registration page [closed]
- How to disable autocomplete on the wp-login.php page
- Share login data/cookies between multiple installations
- Synchronize WordPress user accounts across multiple domains and installations without using WordPress MU
- How do I change the logo on the login page?
- Why does WordPress hide the reset password key from the URL?
- Is it possible to sign in with user_email in WordPress?
- How to use current_user_can()?
- Avoid to load default WP styles in login screen
- WordPress registration message
- How to fake a WordPress login?
- how to display the wordpress login and register forms on a page?
- Does wp_logout_url() destroy a session? (Logging out question)
- How can I send a welcome email to a user AFTER they login for the first time?
- Can not login with correct username and password
- How can i increase the login expiration length?
- How do I use add_action from a class method?
- How to remove the WordPress logo from login and register page?
- How can I add a custom script to footer of login page?
- Brute force attack?
- Customize wp_new_user_notification_email()
- How to check WordPress website username and password is correct
- Login email after registration never sent or received