How to Add a Super Admin User Role in WordPress Multi-site

  1. Steps to Add a Super Admin in WordPress Multisite

    1. Log into the Network Admin Dashboard:
      • Navigate to your WordPress Multisite’s Network Admin area.
      • You can access it from the My Sites > Network Admin > Dashboard in the top toolbar.
    2. Access the Network Users Screen:
      • Go to Network Admin > Users to view all users across your multisite network.
    3. Find or Add the User:
      • If the user already exists in the network, locate their username in the list.
      • If the user doesn’t exist, click the Add New button and create a new user. Ensure you assign a unique username and a valid email address.
    4. Grant Super Admin Privileges:
      • Once the user exists on the network, click on their username to open their profile.
      • Check for the Super Admin option and enable it. If the option isn’t visible, you’ll need to proceed with manual code editing.
    5. Manually Add Super Admin via Code (if needed):
      • If you can’t assign the Super Admin role through the dashboard, use this method:
        1. Open your site’s wp-config.php file or access the WordPress files through FTP or cPanel.
        2. Add the following PHP code snippet to your theme’s functions.php file or via a custom plugin:
          php
          function add_super_admin_role() {
          $user_id = 1; // Replace with the user ID of the user to become Super Admin.
          grant_super_admin($user_id);
          }
          add_action('init', 'add_super_admin_role');
        3. Replace 1 with the specific User ID of the user you want to promote to Super Admin.
    6. Verify the Changes:
      • Log in as the new Super Admin user and navigate to the Network Admin Dashboard to ensure access has been granted.
    7. Remove Temporary Code (if added):
      • If you used the PHP snippet, remove it after verifying the Super Admin role to prevent unnecessary executions.


    Tips:

    • Ensure you assign the Super Admin role only to trusted individuals, as they have complete control over the network.
    • Always back up your WordPress database before making changes, especially if editing files manually.
    • Use a plugin like User Role Editor for easier role management in the multisite environment.

    If you encounter issues, feel free to ask for further clarification!

Social Share

Leave a Comment