Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was looking at the user table and noticed for a super admin ( have access to network admin panel ) and an admin to a network site have same wp_capabilities which is a:1:{s:13:"administrator";b:1;} and also the wp_user_level is 10 for both.

So, I was wondering what is the database value that differentiate between a super admin and an admin? I don't see any more usermeta that relates to network admin level.

What is the proper way to assign super admin capability to a admin via:

  1. Database Edit.
  2. Via Code.
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Site admins are stored in a site option as an array of usernames.

For example, using SQL in MySQLWorkbench you can do a query such as this:

SELECT * FROM wp_sitemeta where meta_key='site_admins';

To get back a serialised PHP array. Modifying this value by adding your username and user ID will make you a site admin.

If you're just looking to see who is a site admin, you have these functions:

get_site_admins();
is_super_admin();

If on a single site rather than a multisite, any user with the delete_users capability will be regarded as a super admin.

share|improve this answer
add comment

I checked the MultiSite Database and found following two entries in wp_sitemeta table which differentiate between a super admin and an admin.

admin_user_id and site_admins

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.