How to create new admin user via database in WordPress

0

Log into phpMyAdmin control panel and locate your WordPress database:

Click on wp_users table. We want to need to insert our new admin user’s information, so click on the Insert tab: In the insert form, add the following:

  • ID – Select a unique number (in our example, we will use number 7).
  • user_login – insert diffrent username you want to use to access the WordPress Dashboard.
  • user_pass – add a strong password for this username. Make sure to select MD5 in the functions menu (Refer to the screenshot below).
  • user_nicename – Enter a nickname or any “nice” name for this admin user.
  • user_email – Enter the email you want to associate with this account.
  • user_url – Enter the URL to your website.
  • user_registered – Insert the date/time for when this user is registered.
  • user_status – set this to 0.
  • display_name– Enter the name you like to display for this user on the site .
  • Click on the Go Button:

Next, we have to add values to wp_usermeta table. Click on the wp_usermeta table and then click on the Insert tab :

Then add the following information to the insert form:

  • unmeta_id – leave this ID blank (it will be auto-generated).
  • user_id – this will be the id of the user you created in the previous step. Remember we enter 7.
  • meta_key – this should be wp_capabilities.
  • meta_value – insert this: a:1:{s:13:”administrator”;s:1:”1″;}

Insert another row with the following information:

  • unmeta_id – leave this blank (it will be auto-generated).
  • user_id – this will be the id of the user you created in the previous step. Remember we enter 7.
  • meta_key – this should be wp_user_level
  • meta_value – 10.
  • Then click on Go button:

Now you will be able to log into your WordPress dashboard with the username and password you specified for this user.

Share.