Adding Super Admin Access for WPMS

Image of a Superman bearing WordPress symbol on chest

Super Admin -image found at https://ben.lobaugh.net

While I’m on the sysadmin blogging tip, wanted to record another issue that came my way this week so I can remember how to solve it. WordPress Multisite (WPMS) is probably the application I am most comfortable with supporting (which is probably not saying much) because I have a pretty good sense of the way in which it abstracts the global database tables from the individual blog site tables. So, when I got a ticket this week letting about an issue with super admin access to the Network features, I was fairly certain I could solve it, especially since I asked for help with a similar issue with one of my own blogs earlier this year when moving it from a WPMS environment to a one-off WordPress blog

So, the issue here was an super admin could no longer access the Network admin dashboard after their LDAP details changed. To update the LDAP plugin they needed super admin access, but when I checked the user table there was no super admin.* Anyway, there are a few ways to give a user super admin access as Andy Feliciotti blogged brilliantly already. Given I had no users with super admin access, I was going to have to take the phpMyAdmin route which entails editing the “admins” field in the “wp_sitemeta” table. I’ll quote Feliciotti below given he was quite clear:

You’ll see some serialized data in the value of the field such as “a:1:{i:1;s:5:”admin”;}”. When you’re dealing with serialized data it can get a bit odd, but adding an admin with the user name “Andy” would be done as follows.

"a:2:{i:1;s:5:"admin";i:2;s:4:"Andy";}"

So as you can see the first number a:2 matches how many entries you have so for 3 admins you’d put 3. I simple just copied and pasted the first bit “i:1;s:5:”admin”” and added a semicolon to indicate another entry. Then increased the i by one and s matches how many characters are in the username, in my case 4. If you enter any of the variables wrong you’ll know by checking to see if your new user is an admin.

I did this and was able to restore super admin access to the user, and they could do what they needed to do, which is always nice. As for why this happened, well that might be fodder for another post when I figure it out.


*The cause of the underlying issue is one I am still looking into, not sure if the LDAP details changing had anything to do with it, but I am thinking no.

This entry was posted in sysadmin, wordpress multi-user, wpmu and tagged , , . Bookmark the permalink.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.