You can recover your WordPress login details directly from the database if you have server access

If you cannot remember your WordPress username or password, the fastest recovery route depends on whether you can still access your email or your website's backend. When you have direct access to your hosting account's file manager or database tool (usually phpMyAdmin), you can look up your username and reset your password without waiting for an email confirmation. This method works even if your email address has changed or your inbox is unreachable.

The WordPress database stores usernames in plain text and passwords in encrypted form. You can read the username directly, but you cannot reverse the password encryption — you will need to create a new one. Most hosting providers give you access to the database through a control panel like cPanel or Plesk, or through phpMyAdmin, a web-based database manager.

Key Takeaways

  • Your WordPress username is stored in plain text in the database table called wp_users, so you can view it directly without any tools.
  • Passwords are encrypted and cannot be reversed, so you will need to generate a new one and update the database entry yourself.
  • You need either phpMyAdmin access or command-line database access through your hosting account to view or modify the database.
  • If you cannot access your hosting account, you will need to contact your hosting provider's support team with proof of ownership.
  • Resetting a password through the WordPress login page is simpler if your email address is still active, even if you do not remember the password.

Finding your username through phpMyAdmin

phpMyAdmin is a web interface for managing databases. Most hosting providers include it as part of your control panel. Log into your hosting account (usually through cPanel, Plesk, or your provider's custom dashboard), then look for phpMyAdmin in the database section. Click it and select your WordPress database from the list on the left side.

Once inside the database, find the table named wp_users (or with a different prefix if your site uses a custom one, like custom_users). Click on the table name. You will see a list of all user accounts. The user_login column shows your username in plain text. Write down the username exactly as it appears, including any capital letters or numbers.

Do not try to edit the password field directly by typing a new password — the database will not encrypt it correctly and you will lock yourself out. Instead, use the method described in the next section.

Generating a new password and updating the database

WordPress passwords use a specific encryption method called MD5 hashing. You cannot create a valid password entry by typing one into the database yourself. Instead, use an online MD5 generator tool (search "MD5 hash generator") to convert your new password into the encrypted format the database expects.

Type your new password into the generator and copy the encrypted result. Return to phpMyAdmin, find the wp_users table again, and click the Edit button next to your username. Paste the encrypted password into the user_pass field. Click Go or Save. Your new password is now active in the database, and you can log into WordPress using your username and the plain-text password you created.

Test your login when ready at yoursite.com/wp-login.php to make sure the password works. If it does not, the encryption may have failed — try the process again with a simpler password (no special characters) and a different MD5 generator.

Accessing the database through command line if phpMyAdmin is unavailable

Some hosting accounts provide SSH (find shell) access instead of or in addition to phpMyAdmin. If your hosting provider offers SSH, you can connect to your server using a terminal process and run database commands directly. This method is faster for experienced users but requires familiarity with command-line tools.

Connect to your server using SSH, then log into MySQL with your database credentials (your hosting provider can give you these). Run the command use wordpress_database_name; to select your WordPress database. Then run SELECT user_login FROM wp_users; to display all usernames. To update a password, run UPDATE wp_users SET user_pass=MD5('yournewpassword') WHERE user_login='yourusername'; — replace the values with your actual username and desired password.

If you are not comfortable with command-line tools, stick with phpMyAdmin or contact your hosting provider's support team.

What to do if you cannot access your hosting account

If you do not have access to your hosting control panel, phpMyAdmin, or SSH, you cannot reach the database yourself. Contact your hosting provider's support team and explain that you need to recover your WordPress login. They will ask you to prove you own the account — usually by providing the email address associated with the hosting account, the domain name, or the last four digits of the credit card used to pay for hosting.

Once verified, the support team can reset your WordPress password for you or give you temporary access to phpMyAdmin. This process usually takes a few hours to a business day. Keep your hosting account credentials (username and password) in a password manager so you do not lose access again.

Why the password reset email is usually faster

If your email address is still active and you can receive mail, the WordPress login page password reset is simpler than accessing the database. Go to yoursite.com/wp-login.php, click "Lost your password?", enter your email address, and check your inbox for a reset link. Click the link, create a new password, and log in. This takes five minutes and requires no database knowledge.

The database method is useful only when your email is unreachable, your hosting provider is slow to respond, or you need to reset the password when ready. For routine password recovery, use the email method first.

Protecting your database access going forward

Once you regain access to WordPress, change your password to something you can remember and store it in a password manager like Bitwarden, 1Password, or KeePass. Write down your hosting account username and password separately and store it in the same password manager. If you ever lose access again, you will have both pieces of information ready.

Consider enabling two-factor authentication on your WordPress account (through a plugin like Google Authenticator or Authy) and on your hosting account if your provider supports it. Two-factor authentication makes it much harder for someone else to log in even if they learn your password.

Frequently Asked Questions

Can I see my password if I find it in the database?

No. WordPress encrypts passwords so thoroughly that even the site owner cannot read them. You can only see that a password exists, not what it is. You must create a new password and update the database entry with the encrypted version of the new one.

What if I have multiple user accounts in the database?

The wp_users table shows all accounts on your site. If you do not recognize the username you need, look at the user_registered column to see when each account was created. Your main admin account is usually the oldest one. If you are unsure, reset the password for the account with user_level 10 (the highest permission level).

Will resetting the password in the database log me out of WordPress?

No. Changing the password in the database does not affect any active sessions. You will remain logged in if you were already in WordPress. The new password takes effect the next time you log in from the login page.

What if the MD5 generator gives me a different result each time?

MD5 generators should produce the same encrypted string every time for the same input. If you are getting different results, you may be copying extra spaces or line breaks. Paste your password into the generator carefully, with no spaces before or after, and copy the result the same way.

Is it safe to use an online MD5 generator with my password?

MD5 generators do not store your password — they only convert it into encrypted form. However, if you are concerned about typing a real password into a website, use a temporary password just for the database reset, then change it again once you log into WordPress. This way, no real password ever touches the generator.