# Add a Team Member to Every New Site

> Adds a chosen user, such as your support or editorial account, to each newly created site with the role you pick.

- Type: PHP
- Runs: Run everywhere
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: new-site, users, roles
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-new-site-add-team-user/

## Code

```php
if ( ! is_multisite() ) {
    return;
}

$wpide_login = 'support';  // Existing username to add.
$wpide_role  = 'editor';   // Role on the new site.

add_action( 'wp_initialize_site', function ( $site ) use ( $wpide_login, $wpide_role ) {
    $user = get_user_by( 'login', $wpide_login );

    if ( $user && ! is_user_member_of_blog( $user->ID, $site->blog_id ) ) {
        add_user_to_blog( $site->blog_id, $user->ID, $wpide_role );
    }
}, 200 );
```

## Notes

Set $wpide_login to an existing username and $wpide_role to any role that exists on new sites.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Add a Team Member to Every New Site" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
