Add a new WordPress user with phpmyadmin

Posted by

More than once I’ve found it convenient to add a new WordPress user through phpmyadmin (MySQL). Usually it’s because someone has locked themselves out, or I need to start managing a WordPress website for a client, where the owner doesn’t know how to log in.

 

Let’s start by creating a new WordPress user

First thing you would want to do, is to log into your cPanel/Control panel, where you can access phpmyadmin. If you are using a webhost like GoDaddy, you can find it once you’ve logged into your cPanel.

Select the database where you installed your WordPress website.

Find the table called wp_users and click it.

Select the tab called Insert.

Fill in these five columns in the wp_users table

Fill in the following fields.

  • user_login
    Type in the username you want to use.
  • user_pass
    Type in the password you want to login with.
    In the functions dropdown select MD5.
  • user_email
    Write in the e-mail you want to use for this account.
  • user_registered
    Select a time prior to this very second.

Click on Go whenever you have filled in the required fields.

 

Add administrative rights to your new user

Last, but not least, we need to make sure your new user have administraive rights.

Firstly we need to check what ID your new user got. Go to the wp_users table to see. The ID will be visible on the left of user_login.

Now go to the table with the name wp_usermeta. Should be right under wp_users.

Select the Insert tab, just like we did previously.

adding a new WordPress user with admin rights

Fill in the following fields.

  • user_id
    Type in the ID of your new user.
  • meta_key
    Type in wp_capabilities.
  • meta_value
    Type in a:1:{s:13:”administrator”;s:1:”1″;}

Finish up by pushing the Go button once again.

 

That’s it! You should now have a new user with admin rights. You can now try to log in with your new WP user.

Leave a Reply

Your e-mail address will not be published. Required fields are marked *