A rare situation, but in those rare instances when your website has been hacked and your WordPress user account has been changed from the role of Administrator to something else entirely, it may be easiest to simply change your WordPress user account back to Administrator using phpMyAdmin.

To change your WordPress user account from Subscriber to Administrator, first log into your cPanel. Then click the “phpMyAdmin” button.

cPanel phpMyadmin


You’ll see your list of installed databases at left.

phpMyAdmin List of Databases


If you are not sure which database your WordPress installation is using, then use your cPanel -> “File Manger” to “Edit” the contents of your WordPress configuration file, wp-config.php file.

WordPress wp-config.php Databae Name (DB_NAME)


Back to phpMyAdmin. Click your database and scroll down until you find the ‘usermeta‘ table.

WordPress Database Usermeta Table


My goal here is to change the user lmadmin1 from Subscriber to Administrator.

Wordpress Users List Subscriber example


Doing so is fairly easy.
After clicking the ‘usermeta‘ table, all I need to do is scroll down within the table until lmadmin1 appears in the list.

A database table displays multiple rows and columns of data entries. One row highlights a record for


Ten or so lines below the user lmadmin1, is the line ‘user_level

WordPress Database User Level and Capabilities


To switch my lmadmin1 user from the role of Subscriber to Administrator, I have to do two things:

  1. Change the value from 0 to 10 on the ‘user_level‘ line
  2. Replace the ‘capabilities‘ meta_key value text with ‘a:1:{s:13:"administrator";s:1:"1";}


The moment I type or paste in the text and hit the enter key I should be able to jump back into WordPress and log in with full Administrator privileges.

Changing WordPress Subscriber to Administrator within the database using phpMyadmin


It’s really that easy!

Wordpress Users List Administrator example





Please feel free to comment via WordPress, Twitter, or Facebook

Proactive WordPress Security Management for Pennies a Day™
© Copyright 2024 HackGuard.com™, HackRepair.com™,
The Hack Repair Guy™, Hack Repair Guy™
Copyright and Trademark Statement | Privacy Policy

Call HackRepair.com for website security help, (619) 479-6637.
Content Approved By Jim Walker, The Hack Repair Guy