Create a WordPress administrator via phpMyAdmin

⌘K

Sometimes you may have lost access to WordPress admin or you’re working on a website where the client has lost their administrator access. This cheeky hack will teach you how to create a WordPress user with administrator privileges using phpMyAdmin.

To follow this guide you need your cPanel login credentials. If you have forgotten your cPanel credentials, they were included in the original Welcome to mxNAP or IMPORTANT: Hosting Documentation email which you should find in your inbox, otherwise follow these instructions on how to update your cPanel password.

  1. Login in to your cPanel account and navigate to phpMyAdmin
  2. Select the database from the list on the left hand side of phpMyAdmin’s web interface
    If you don’t know which database is correct, check the wp-config.php file for the website and locate the database name next to DB_NAME.
  3. Select the table wp_users
  4. Select Copy next to a user table
  5. Update the columns labelled user_loginuser_nicenameuser_email and display_name to your preferred WordPress username details and email address. Once you have completed your changes, select Go
  6. To assign the new user administrative privileges, reference the ID of the new user and keep the user ID on hand for the following steps. In the below example, the new users ID is 2
  7. Change in to the wp_usermeta table by selecting wp_usermeta from the left hand side index
  8. Find a row which has a meta_key with the value wp_capabilities and the meta_value as a:1:{s:13:”administrator”;b:1;}, select Copy
  9. Update the user_id column with the ID of your new WordPress user and select Go!
  10. To set the password for the new user, navigate to /wp-admin and request a password reset. Once that step is complete, you can login and manage the website with your new WordPress administrator!