Knowledge base article

Create a WordPress administrator via phpMyAdmin

This article will teach you how to create a WordPress user with administrator privileges using phpMyAdmin in cPanel

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 Serversaurus 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_login, user_nicename, user_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!

Last updated November 30, 2023

Can't find what you're looking for?

Submit a question

  • Drop files here or
    Max. file size: 2 MB, Max. files: 3.
    • This field is for validation purposes and should be left unchanged.