VPS business hosting starting at $29.95/24/7 premium technical support

How to change WordPress user roles in MySQL database using PhpMyAdmin?

We will be editing the database rows using PhpMyAdmin tool given with cPanel by many hosting companies

You can change the WordPress user roles by following the given steps:

Step 1: Open phpMyAdmin on cPanel.

Step 2: Open the wp_usermeta or xxx_usermeta table in the database as highlighted. (wp_ is just prefix, your table prefix may be different)

wordpress tables in database

Step 3: In wp_usermeta table, you can find wp_capabilities under meta_key column.

User Roles in usermeta table

Step 4: The roles are saved in form of serialized PHP array. Change the user role you want to assign to the current user by changing the meta_value as:

Subscriber
a:1:{s:10:"subscriber";b:1;}

Contributor
a:1:{s:11:"contributor";b:1;}

Author
a:1:{s:6:"author";b:1;}

Editor
a:1:{s:6:"editor";b:1;}

Administrator
a:1:{s:13:"administrator";b:1;}

Author: Harshvardhan Malpani

PHP Developer based in New Delhi, India. Working as a freelance web developer providing server deployment, website development and maintenance services.

14 thoughts on “How to change WordPress user roles in MySQL database using PhpMyAdmin?”

  1. This is perfect!
    I was mucking around with a local dev site and just emptied the usermeta table without giving much thought, but I was able to add the admin capabilities because of this. Thanks 🙂

  2. I’ve just noted that this works for a single installation and doesn’t work for a multisite. Any workaround for that?

  3. I managed to remove my permissions to update wordpress site when I was in wishlistmember dashboard. I’ve tried updating in MYPHPadmin but there is no privileges option – help!

  4. Hi there, Im also faced with an issue where I cannot access anything in wordpress dashboard as a main user. I tried the above but no luck. Can’t edit site, neither access plugins, themes, woocommerce, etc.
    any advice please?

Leave a Reply to Dr Sadaqat Cancel reply

Your email address will not be published. Required fields are marked *