Many reasons require you to add a new WordPress administrator user, such as a hacked website or a forgotten existing WordPress administrator user password.
In such a scenario, we can easily create a new WordPress admin user from the WordPress database, which can be done via phpMyAdmin without accessing the WordPress dashboard by following the steps given below –
1. First, log in to your cPanel account.
You may refer to ‘How to log in to the cPanel Account.’
2. Inside the databases, click on phpMyAdmin.
3. Find and click on your WordPress database.
4. Click on the WordPress table name wp_users.
5. Click the Insert button.
6. Add the details given below and click on the Go button -
- user_login: Enter the username of the new admin user.
- user_pass: Insert the password for the admin and select MD5 from the Function drop-down.
- user_email: The email address that you want to use.
Ensure that you have access to that email account. - user_registered: Select the current date and time for user registration.
- user_status: Set 0 (Zero) in this box
7. Get back to the wp_users and note the ID of your WordPress user.
8. Now, select the wp_usermeta table and click on Insert.
9. Add the details below and click on the Go button.
- user_id: Enter the user ID you noted in step no- 7.
- meta_key: Add wp_capabilities
- meta_value: Enter the a:1:{s:13:"administrator";s:1:"1";}
You can log in to WordPress admin using the newly created account.