You can’t log in. You click to reset the password — the email doesn’t arrive even after ten minutes.
That is a second problem (the server isn’t sending email), but right now you need to get in. Here are three ways.
1. Through phpMyAdmin — the fastest
Go to cPanel → phpMyAdmin → select the database → the wp_users table.
Find your user and click Edit. In the user_pass field:
- In the Function column, choose MD5
- In Value, type the new password as plain text
- Save
WordPress accepts the MD5 value on the first login and immediately converts it to a stronger format.
Careful: the prefix may not be wp_. Look in wp-config.php for $table_prefix.
2. Through functions.php — if you have no access to the database
In the theme, at the beginning of functions.php, add:
wp_set_password('NewPassword123', 1);
The number is the user ID — usually 1 for the first admin.
Open the website once, then delete the line immediately. If it stays, the password is reset on every page load and you will never be able to change it.
3. A new admin through code
If you don’t even know the username:
wp_create_user('new_admin', 'password123', 'you@example.com');
$u = new WP_User(get_user_by('login','new_admin')->ID);
$u->set_role('administrator');
The same rule applies — delete it once you are in.
Now fix the email
You are in, but the email problem remains — and that means other emails aren’t arriving either: order confirmations, notifications, the contact form.
The cause is almost always the same: WordPress sends through a PHP function without authentication, and recipients reject the message.
The fix: an SMTP plugin plus an email address on your domain. Then mail goes through a real server and arrives.
So it doesn’t happen again
Create a second admin with a different email address — on a different domain, not on the same website. If one way in fails, you use the other.
And keep your passwords in a password manager, not in your head.
Don’t want to maintain WordPress yourself — updates, backups and security? We take care of it.
WordPress maintenance →