This happens to me once in a wile. I have to do work on a wordpress site, the emails in the admin accounts are not managed by me, so I can not user password recovery or I don’t even know the admin account email or user name. In these cases I just edit the password field in the database, adding a MD5 hash of the new password.
First step I search for a MD5 Hash Generator in google and generate the hash for my password, exmple:
Password: Pass123!
Hash: 10487c8581423e8b2fbeed2b21c2cc53
Then I edit the database table that normally is called wp_users. The wp_ prefix can vary from site to site.
The most common way to edit the database is using PhpMyadmin via Capnel os other access method. In some cases I work with servers that do not have cpanel and do not expose PhpMyadmin to the public network so I have to do it via terminal with an ssh connection:
> mysql -u root -p
you will be prompted for the password.
Figure out what user we have
>use database_name;
>select * from wp_users \g;
>update wp_users set user_password = '10487c8581423e8b2fbeed2b21c2cc53' where ID =
The where ID part is the id of the user we want to edit