Home WordPress Conditional Functions is_super_admin() WordPress is_super_admin() Function Definition In WordPress, is_super_admin() returns true when a user is a Super Admin . On a Multisite network this is a user who can manage the whole network.
On a normal single-site install, it returns true for a user who has full control, which means an Administrator. With no argument it checks the current user.
Syntax Use it as the test of an if statement.
if ( is_super_admin() ) {
// code for the true path
} else {
// code for the false path
} Call What it does is_super_admin()True if the current user is a Super Admin. is_super_admin( 5 )True if the user with ID 5 is a Super Admin. current_user_can( 'manage_network' )Another way to check network permission.
Do not confuse it with is_admin(), which checks the dashboard screen, not the user.
Full declaration is_super_admin( int|false $user_id = false ): bool Parameters Parameter Description $user_idOptional. The user ID. Default is false, which means the current user.
Return Value Return Value Description bool true if the user is a Super Admin, otherwise false.
WordPress Examples Three short theme examples. Each one shows what prints on the true path and the false path.
1. Check the current user 2. Check a user by ID 3. Network feature only Example 1 — Check the current user Show a tool only to Super Admins.
<?php if ( is_super_admin() ) {
echo '<a href="/wp-admin/network/">Network Admin</a>';
} ?> Super Admin (true):
<a href="/wp-admin/network/">Network Admin</a>
Other user (false):
(nothing is printed) How It Works is_super_admin() checks the current user.The link is printed only for a Super Admin. Everyone else sees nothing. Example 2 — Check a user by ID Test any user.
<?php if ( is_super_admin( 5 ) ) {
echo 'User 5 is a Super Admin.';
} else {
echo 'User 5 is not a Super Admin.';
} ?> If user 5 is a Super Admin (true):
User 5 is a Super Admin.
Otherwise (false):
User 5 is not a Super Admin. How It Works The argument 5 is a user ID. The if branch handles true. The else branch handles false. Example 3 — Network feature only Combine with is_multisite().
<?php if ( is_multisite() && is_super_admin() ) {
echo 'Network settings are available.';
} ?> Network Super Admin (true):
Network settings are available.
Single site or normal user (false):
(nothing is printed) How It Works is_multisite() checks the install.is_super_admin() checks the user.Both must be true. Frequently Asked Questions What does is_super_admin() return? It returns true or false (a bool). Use it inside an if statement.
What is a Super Admin? On Multisite, a Super Admin can manage every site and the network settings. A site Administrator can manage only one site.
What does is_super_admin() return on a single site? It returns true for users who have full control, which means Administrators.
Is is_super_admin() the same as is_admin()? No. is_admin() checks if you are in the dashboard. is_super_admin() checks the user.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
7 people found this page helpful
Helpful Share Copy link Suggestion