In this article, I want to demonstrate how easy it is to add an admin user to a WordPress website. Sometimes, you don’t want to overwrite an existing website, but you lose the admin account password, and your website doesn’t send a password reset. So, if you are looking for this solution, you are in the right place.
First Step
Log in to your hosting account and open phpMyAdmin. Usually, in the hosting admin panel, you will find the login and password for phpMyAdmin, making it easy to access.
Second Step
Open the table “wp_users” if you are using the default “wp_” prefix, or “your_prefix_users” if you have a custom prefix.
Third Step
Click on “Insert” to add a new row to the table and fill out the following fields:
- ID – Leave empty!
- user_login – The username for this user (example: user-name).
- user_pass – Enter your desired password, and be sure to select “MD5” from the dropdown to the left. Otherwise, it will not work.
- user_email – The email address associated with this user.
- user_status – Set this to 0.
- display_name – The display name for the user (example: Your Name).
- Time – Choose any date (example: a day before).
Then, click on “wp_users” and remember your user ID.
Last Step
Now, open wp_usermeta table (if you use the “wp_” prefix).
You need to add two records:
a. First Record
Click “Insert” to add a new row and fill out:
- umeta_id – Leave empty.
- user_id – Enter the user ID you noted earlier.
- meta_key –
wp_capabilities - meta_value –
a:1:{s:13:"administrator";b:1;}
b. Second Record
Add another new row to the table:
- umeta_id – Leave empty.
- user_id – Enter the user ID you noted earlier.
- meta_key –
wp_user_level - meta_value –
10
🎉 Whoooohoooo, it’s done! 🎉 Now, you can open the login page and try to log in with your credentials. I hope you succeed! If not, please go through all the steps again carefully or watch the video where I demonstrate the process.
Explore my blog page for more articles on WordPress and Elementor. You’ll find a range of useful guides to help you enhance your website.
Also, check out my YouTube channel where I demonstrate more Elementor and WordPress tricks and tutorials. Don’t forget to subscribe for the latest tips!