You’ve lost access to your site and you don’t know how to get in again. Normally you can reset your WordPress password in the dashboard or request a new one via email. WordPress stores user passwords in hashed form in the database. You can not find out what saved passwords are. In this post, we’ll walk you through a few quick and easy steps on how to change or reset WordPress password. There are several ways to reset a WordPress dashboard password.
If you don't have access to your email or your WordPress site isn't sending emails correctly, then changing the WordPress admin password directly from the database via phpMyAdmin might be the only solution you have.
How to change WordPress password from PhpMyAdmin?
- Login to the cPanel dashboard of your WordPress hosting account.
- Click on the phpMyAdmin icon under the database section.
- On the left-hand side, click on the database WordPress is associated with.
- Click "wp_users" table located on the left. You can have a table prefix added. In this case, it may be named slightly differently, such as "wp_pre_users".
- You will now see the rows in your WordPress users table. Click on the "Edit" button next to the username where you want to change the password.
- Select MD5 in the "Function" column, type in your new strong password into the "user_pass" box and click "Go".
How to change WordPress user password via PHP?
- Download the PHP file to your computer.
WordPress User Password Reset - Upload the PHP file via FTP to the root directory on your server where WordPress is running.
- Open the address by typing the path of the PHP file into the browser. Example: https://example.com/wordpress-user-password-reset-tool.php
- You will see the database name where WordPress is installed, the database user, the database password, the table prefix, and the table listing all WordPress users.
- Click the "Reset" button for the user whose password you want to change. When the page is opened after clicking, the user's password will be reset directly. A new password with random numbers like "AtakanAu_01234567" will be determined.
- If you want, press the "Back" button to return to the listing page for another password reset, or press the "Login" button to log in to the WordPress administration panel with the username and new password in the tab that will open.
Create an admin user in WordPress Database via PHP
As a developer, you may need to create a new administrative user in the database to access the site. For example, this is required when exporting a WordPress database, but you are not provided with login credentials for the admin user.
Of course, you can access it through the database. However, many developers are not very comfortable with MySQL and the process is rather slow compared to what I'm going to show you. Here is the easy way to create a new WordPress admin account:
- Upload the above PHP file to your server and open it in your browser.
- Enter a value for the required "Login" field. You can optionally write "Nicename", "email" and "Display name" parameters.
- After clicking the "Create" button, a new administrator account will be created with the username you specified in the "Login" field. A new password with random numbers like "AtakanAu_01234567" will be determined.
0 Comments