How to manually create a WordPress admin user using phpMyAdmin

Creating WordPress admin username and password using phpMyAdmin is very useful one, if you locked out of your WordPress site because of website hack or if you forget your WordPress admin username and password. To do this you need to have access to Control Panel (or cPanel) of your website server. I  will show you How to manually create a wordpress admin user using phpmyadmin in this article.

Manually create a wordpress admin user using phpmyadmin:

Login to your Cpanel control panel and click the phpMyadmin link under the Databases section. It will open the phpMyAdmin in a new window.

Now select your WordPress installed database from left sidebar. Then scroll down and find wp_users table and click it. Note: Assuming database table prefix is set to “wp_”. You can change the prefix according to yours.


It will show all current users in your WordPress install.

Then click the insert menu from the top.

Then fill in the following fields to insert a new user record in the wp_users table.

ID – Keep empty
user_login – type the username you want to as admin username
user_pass – Select MD5 in the functions menu and Type admin password in the value field.
user_nicename – Type your name
user_email – enter your email address.
user_url – Type your website url
user_registered – select the date and time.
user_activation_key – keep empty
user_status – Enter 0.
display_name – Type your display name

Also Read:  WordPress Speculation Rules Dynamic Prefetching and Prerendering

Then click the the Go button.

To verify the details click the “Browse” top menu button and check your details. And note down the ID number of the user.Here its 43.

Now from the left sidebar click the wp_usermeta table and then click Insert top menu button.

Then fill in the following fields to insert a new user record in the wp_usermeta table.

umeta_id – keep empty.
user_id – This will be the same ID of the user from the wp_users table, which is 43 for mycase.
meta_key – Type wp_capabilities in the field .(assuming that your database table prefix is “wp_”).
meta_value – Type this: a:1:{s:13:”administrator”;s:1:”1″;}

Then click the Go button. Again click the insert from top menu and add another record.

umeta_id – keep empty.
user_id – This will be the same ID of the user from the wp_users table, which is 43 for mycase.
meta_key – Type wp_user_level (assuming that your database table prefix is “wp_”).
meta_value – Type number 10

Click the Go button.

Now you should be able to login to your WordPress wp-admin dashboard with this new admin username and password .

If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



This Post Has One Comment

  1. Sadurshan Saravana

    Well done. Very clear explanations and loved the article! THAT WORKE..

Leave a Reply