You are using the user email as the user login. Your code, formatted for readability, looks like:
$resetQuery = $wpdb -> query(
$wpdb -> prepare(
"UPDATE wp_users
SET user_pass = %s, user_activation_key = ''
WHERE user_login = %s AND user_activation_key = %s",
$hashedPwd,
$useremail,
$key
)
);
The $useremail
argument matches the user_login = %s
placeholder.
Having the user_login
match user_email
is not normal. Unless you have altered your user registration so that the login always matches the email that isn’t going to work, and I suspect that that is your problem. You need to rewrite the query, and/or supporting code, so that either the query matches user_login
to user_login
or user_email
to user_email
.
Related Posts:
- wordpress redirect after password reset
- Force all users in MU to change their passwords
- Reseting admin password through PHPMyadmin fails
- Check Password Reset Key Not Woking
- Reset password – set minimum length for new password
- Password reset message – change the network_home_url( ‘/’ )
- Lost password link is redirecting to /shop/my-account/lost-password/
- password recovery key is invalid on custom reset
- Send password to user instead of reset password link
- How to change “Reset Password” text on submit button
- Customize retrieve password message
- How to initiate password reset flow by code
- WooCommerce Lost Password reset goes to 404
- I have to reset the admin password each time
- Sending Reset Password email via Web API
- Problem with login / reset password links in users emails
- How to set password from frontend if have activation key and user login in url in wordpress?
- Reset Password – change from name and email address. It stucks at admin. Want to change it to info
- How to Disable Pre-population of Password on Password Reset
- How to change user password with wp-cli?
- Disable user registration password email
- Loosen/disable password policy
- Password Protect Custom Page
- Password protecting a page
- How do I create a password reset link?
- How to save Admin FTP password
- How can I change the default wordpress password hashing system to something custom?
- If I change the salt keys in my wp-config will all passwords break?
- How to add Wp_error using lostpassword_post hook when validating custom field?
- Duplicate hash method for password in .NET
- Hide password protected posts
- Access code/password only restricts page access, no user registration..?
- PasswordHash not found in namespace
- How to shorten length of auto generated password sent during registration?
- wp_hash_password unexpected behaviour
- Change default recovery link expiration time
- Set content type to HTML for lost password email only
- Make post password required to publish
- Add error message on password protected pages
- User password field is empty
- How to change the language of the ‘Reset Password’ page
- Why is resetting the WordPress Users password not working?
- Get plain password on register
- How to customize reset_url or $reset_url
- post_password_required() not recognizing cookie set with correct password
- Password protect the site (without htaccess or membership)
- Password Protected page not asking for a password
- I would like to password protect my entire WordPress site (ip validated), except for one page
- Custom login form for front-end user as well as admin
- how to remotely check a username / password from within a plugin
- Forgot Password/ Password Reset Page does not exist
- Password changed [duplicate]
- How to get user password before being encrypted outside the wordpress core once add a new user from dashboard?
- wp_hash_password create a different hash everytime
- How to change password
- Password protect pages – allow more than one password
- Password Protected Post is invisible until you login
- Protect Passwords in wp_users with stronger protection than MD5
- How secure is a wp-config file?
- How to check user’s password?
- How to Remove or Deactivate “Application Passwords” in WordPress
- What’s the algorithm to verify user password?
- resend user login & password with custom button
- How to show my wordpress admin username & password?
- Why does hashing a password result in different hashes, each time?
- Change password fields
- How to read third party cookie to access password protected pages
- Ask logged in user to re-enter password to access page “x”
- Password protected sites
- How would I create a Password Protected Page with Content on it?
- Site only for users authenticated by different PHP application
- wordpress custom password change problem
- Allow all reset password links within the past 24 hours to be valid and accepted
- Set id and password for each post
- I need help with wp_lostpassword, wp_register and wp_login_form
- Create Member who can’t be changed
- Reset WordPress admin users to limit access
- $expiration_duration = apply_filters( ‘password_reset_expiration’, DAY_IN_SECONDS );
- Frontend custom forgot password page
- WordPress password reset not working
- Entering a WP site with a SMS code
- Password Protect content() on homepage
- Function called by password_reset action passed only 1 argument instead of 2 in PHP 7.2.11
- Allow users from my ASP.Net MVC site to access my private WordPress site
- Lost Password redirect to My Account
- Multiple pages protected by different passwords. Possible to track multiple passwords at a time?
- WordPress Protected Page Redirects to PDF
- Not able to log for the first time on a salted WordPress by creating pwd on BD
- Bypass a WordPress Password Protected Post or Page via a URL
- Can I use core passworded page/post functions outside of wp-login.php?
- How do I password protect a page of posts on WordPress?
- forgot password
- Alter the reset password link
- Is it possible to send user new password after they clicking on forgot password in word press
- How WordPress hashes passwords
- check if post is set to “password protected”
- Override the default password length when creating or updating a user profile
- Better way to change the default password reset url with the woocommerce one?
- ‘random_password’ filters not taking effect
- My WordPress password for admin account is changing automatically