Network / Super-admin privileges lost after renaming account
This article will explain how to recover lost super-admin / network privileges upon renaming account or how to manually grant super-admin privileges on a WordPress multisite, by updating the database (with phpMyAdmin or any other database gui).
Should be obvious that you’ll need the username of the account in question so you’ll head off to “wp_users” table to get it. You can either browse through the list of usernames or run the following MySQL Query:
> SELECT * FROM `wp_users`;
Now that you have the user name (“user_login” value) you’ll need to add it to the super admins list. Run the following MySQL Query to get the record responsible for that:
> SELECT * FROM `wp_sitemeta` WHERE `meta_key` = 'site_admins';
You should then see something similar to this:Grant a user super-admin rights by updating the table “wp_sitemeta”
The value for the “meta_value” field is a JSON formatted object and follows this logic:
- (in <a:X>) X is the number of usernames in the array
- (in <i:X>) X is the incremental value in the array (first one is 0, second is 1, so forth)
- (in <s:X:”username“>) X is the number or characters in username
Make sure not to add spaces and use the correct upper/lower case value for the username. Also you’ll most likely need to log off and then log back into your account for changes to take effect.