If you can no longer access your WordPress admin, for example after a website hack, you can reset your password in the WordPress database using phpMyAdmin.
Most Web Hosting providers allow access to your databases via phpMyAdmin or similar tools. As a 1&1 customer, you can access your databases from within the 1&1 Control Panel using phpMyAdmin.
- Open the database that is used for your website using phpMyAdmin. Learn how to access phpMyAdmin (1&1 Help Center)
Tip: The database name is stored in the file wp-config.php. Access your webspace using SFTP and open the file wp-config.php in the root folder of your WordPress website. A search for: DB_NAME will return the database of your website. It should look something like this:
- Open the table prefix_users.
- Search for your user and then select Edit to the left of the row.
- In the user_pass field, delete the hash value.
- You must add your new password as a hash value. You can easily generate a hash for your password using tools like the md5 Hash Generator.
- Select Save and click OK.
You can now login to your website using the new password (not the password hash :-)).
Alternative: Reset password via email
If you don’t want to work with hashes, you can adjust your email address in the user_email field and then use the WordPress password recovery when logging in to WordPress Admin.