How are roles stored in the database?

The core functions:

  • is_super_admin(),
  • grant_super_admin(),
  • revoke_super_admin()

fetch the super admins data from the wp_sitemeta table with:

$super_admins = get_site_option( 'site_admins', array( 'admin' ) );

It’s stored as a serialized array of user logins, for each site, like:


It’s possible to override it with the global $site_admins array.

On the other hand, the general user roles (admin, editor, author, …) are stored as serialized arrays, for each user, like:


in the wp_usermeta table under the wp_capabilities meta key and/or the wp_{$blog_id}_capabilities meta keys.

Note that the wp_ prefix might be different on your install.