How to Create a new WordPress admin user in the database

Sometimes you need to gain admin access to your WordPress site. There are a number of reasons for when this might become an issue:-

  • Lost password and no longer have access to admin email address
  • No longer have access to the developer who was the only admin
  • Developer has left your company
  1. Log into phpMyAdmin
  2. Make sure you select the database for your WordPress site in the left-hand column
  3. Click the _users table
  4. Click the Insert tab
  5. Fill in the following fields.
    • ID - any number you choose that isn't already in use
    • user_login - username for accessing the WordPress Dashboard.
    • user_pass - password for the user. You must select MD5 in the functions menu
    • user_nicename - nickname for the user
    • user_email - email address you want to associate with this user
    • user_registered - date and time for when this user is registered
    • user_status - set to 0
    • display_name - name that will be displayed for this user on your site
  6. Click the Go button
  7. Click the _usermeta table
  8. Click the Insert tab
  9. Fill in the following fields:
    • user_idID you entered in the previous step
    • meta_key - enter wp_capabilities (If you have setup your site to use custom database table prefixes, then you need to include that prefix here (e.g. {CustomPrefix}_capabilities). You can see the prefix in name of each database table in the left-hand column on the current page.
    • meta_value - enter a:1:{s:13:"administrator";s:1:"1";}
  10. Click Go
  11. Click the Insert tab again
  12. Enter the following information:
    • user_id - same number you entered in the previous step
    • meta_key - enter wp_user_level
    • meta_value - enter 10
  13. Click the Go button.

You can now login with the new Admin user

Leave a Reply

Your email address will not be published.