Wordpress can not change password (user_pass field) from phpmyadmin?

Dopani

Well-known member
Registered
Joined
Mar 11, 2014
Messages
233
Points
18
I have not visited my blog for a long time so I could not remember its password, now I enter phpmyadmin and try to add my5 password which generated from PHP code but after pasted into wp_users table with new password into user_pass field then when saved, it immediately change back to old password which encrypted. How can I update new password for my Wordpress from phpmyadmin?
 

Harry P

Well-known member
Registered
Joined
Feb 3, 2015
Messages
447
Points
28
If you are unable to change a WordPress user's password through the user_pass field in phpMyAdmin, it could be due to a few different reasons:

Incorrect password hash format: WordPress uses a specific hashing algorithm called "Portable PHP password hashing framework" to hash passwords. If you try to update a user's password in the user_pass field with a plain text password or a password hashed with a different algorithm, it won't work. You'll need to use the same hashing algorithm that WordPress uses to hash passwords. One way to do this is by using the WordPress function wp_hash_password() to generate the hashed password and then update the user_pass field with the new hash.

You can use the wp_hash_password() function to generate a hashed password in WordPress. This function uses the Portable PHP password hashing framework to hash the password.

Here's how you can use wp_hash_password() to generate a hashed password:
  • Log in to your WordPress admin dashboard.
  • Navigate to the "Users" section and select the user whose password you want to change.
  • In the user profile screen, scroll down to the "New Password" section.
  • Enter the new password you want to use for the user.
  • Open your website's code editor or FTP client and open the functions.php file located in your active theme directory.
  • Add the following code at the end of the functions.php file:
Code:
$new_password = 'enter_your_new_password_here';
$hashed_password = wp_hash_password( $new_password );
echo $hashed_password;
  • Replace enter_your_new_password_here with the new password you want to use for the user.
  • Save the functions.php file.
  • Load any page on your WordPress site to run the updated functions.php file.
  • The hashed password will be printed to the screen. Copy the hashed password.
  • Go back to phpMyAdmin and find the user whose password you want to update.
  • Edit the user record and replace the value in the user_pass field with the copied hashed password.
  • Save the user record.
The user's password will now be updated to the new password you specified.

Database table prefix: If you've changed the default database table prefix for your WordPress installation, the user_pass field might not be called user_pass. Make sure to check the correct field name for the password in the user table.

Incorrect user ID: Double-check that you are updating the password for the correct user ID in the WordPress database. If you're not sure what the user ID is, you can find it in the wp_users table.

WordPress salts: WordPress uses unique salts to add an extra layer of security to password hashing. If the salts in your WordPress installation have been changed or are incorrect, you might not be able to update passwords through phpMyAdmin. Make sure that the AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, and NONCE_KEY constants in your wp-config.php file are correct.

If none of these solutions work, you might want to consider resetting the password through the WordPress admin dashboard or contacting a developer or hosting provider for assistance.

Hope it helps!
 

artemsereda

Member
Registered
Joined
Jul 13, 2022
Messages
38
Points
6
As another way, you can change password via sql request, maybe it doesn't like something via phpadmin: UPDATE wp_users set user_pass = MD5('newpass') where id = your_user_id
 
Latest Threads
Replies
1
Views
14
Replies
1
Views
77
Replies
0
Views
68
Replies
0
Views
76

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top