How to create new WordPress admin user via database

How to create new WordPress admin user via database

In order to create new admin user via database, you should perform the following steps:

  1. Log into phpMyAdmin section on your hosting control panel and locate your WordPress database.

     

  2. Click on wp_users table. We need to insert our new admin user’s information, so click on the Insert tab.

     

    In the insert form, add the following:

    • ID – pick a number (in our example, we will use number 4).
    • user_login – insert the username you want to use to access the WordPress Dashboard.
    • user_pass – add a password for this username. Make sure to select MD5 in the functions menu.
    • user_nicename – put a nickname or any “nice” name for this admin user.
    • user_email – add the email you want to associate with this account.
    • user_url – this would be the URL to your website.
    • user_registered – select the date/time for when this user is registered.
    • user_status – set this to 0.
    • display_name– put the name you like to display for this user on the site (it can be your user_nicename value as well).
    • Click on the Go Button.

     

  3. Next, we have to add the values to wp_usermeta table. Click on the wp_usermeta table and then click on the Insert tab like in the previous step.

     

    Then add the following information to the insert form:

    • 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 picked 4.
    • 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 picked 4.
    • 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.

Was this article helpful?

Related Articles

Leave A Comment?