How to set admin user roles in WordPress through database

take the wp_usermeta table. Once in there, look for the entry that has ‘wp_user_level‘ in it’s ‘meta_key’ column and has the matching ‘user_id’ that you would like to update. Then change that ‘meta_value’ to 9 or 10.

It is also required to update the ‘wp_capabilities‘ meta_key value to ‘a:1:{s:13:"administrator";s:1:"1";}

Thank you.

Leave a comment

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