How to add a new WordPress admin user from within phpMyAdmin Print

  • WordPress, PHPMyAdmin, User
  • 1

You can create a new WordPress admin user directly from the database. Use this method if you have lost your admin user access and need to add a new user to the site without having the ability to sign in to the WordPress dashboard.

Add a WordPress Admin

1 - Open PHPMyAdmin.

2 - Select your database. wp_example - the primary database for the WordPress environment.

3 - Select the wp_users table. If you have a custom database prefix this will instead be yourprefix_users. Be sure to take this into account in later steps as well.

4 - Click the Insert tab at the top of PHPMyAdmin menu.

5 - Fill out the required new user data:

  • ID - Enter any available ID number. You’ll need to know this ID number later!

  • user_login - The username for this user.

  • user_pass - The raw password the user will login with.

  • NOTE: The function dropdown to the left must be set to MD5 or the password WILL NOT WORK.

  • user_nicename - The author slug or name (EX: your-name).

  • user_email - The email address associated with this user.

  • user_status - Set this to 0

  • display_name - The display name for the user (EX: Your Name)

6 - Click the Go button at the bottom of the page, to insert the row.

7 - Click on the next Go button again on the query page. You should get a green check mark and success banner. If you get a red error at the bottom the user has not been inserted. Use the error message to identify the issue and correct it.

Add the correct wp_capabilities row in wp_usermeta.

1 - From the left hand table menu, click wp_usermeta.

2 - Click the Insert tab at the top of PHPMyAdmin menu.

3 - Fill in the following required fields for user capabilities:

  • user_id - Use the same ID from Step 5
  • meta_keywp_capabilities (remember to check your database prefix)
  • meta_value - a:1:{s:13:"administrator";b:1;}

4 - Click the Go button at the bottom of the page, to insert the row.

5 - Click on the next Go button again on the query page. You should get a green check mark and success banner. If you get a red error at the bottom the user has not been inserted. Use the error message to identify the issue and correct it.

Repeat this step for the wp_user_level.

1 - Whilst still in the wp_usermeta table, Click the Insert tab at the top of PHPMyAdmin menu.

2 - Populate the following fields:

  • user_id - Use the same ID as you did in step 5
  • meta_key - wp_user_level (be sure to match the prefix)
  • meta_value - 10

3 - Click on the next Go button again on the query page. You should get a green check mark and success banner. If you get a red error at the bottom the user has not been inserted. Use the error message to identify the issue and correct it.

You should now be able to access your WordPress website with the new admin user and password. If you have issues recheck that each step was completed as described.

If you have a custom database prefix, then ensure you have replaced our instructions with the correct custom prefix table name.

If you are still stuck, reach out to our support team to have this done for you. Note however that if you are not on a managed WordPress plan, this may be billed for.


Was this answer helpful?

« Back