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)
Step 3: In wp_usermeta
table, you can find wp_capabilities under meta_key column.
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;}
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 🙂
really helpful
Thank you, this was helpful. I’ve noted that installing W3SuperCache somehow changed my user permissions.
I’ve just noted that this works for a single installation and doesn’t work for a multisite. Any workaround for that?
Reason for that is because in multisite, user level and capabilities are stored as “wp_2_user_level” and “wp_2_capabilities” meta_keys where 2 is site id
Read more at https://codex.wordpress.org/Database_Description#Table:_wp_sitemeta
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!
Dude, You just saved my life man!
happy to help 🙂
what the rolls code for supper admin (for multisite)
What about for super administrator that manages a network?
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?