# Only Logged-In Members Can Create New Sites

> Keeps the network's signup form open for new user accounts but only lets people who are already logged in create a site, cutting down on spam sites while staying open to new members.

- Type: PHP
- Runs: Run everywhere
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: signup, sites, spam
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-site-signups-members-only/

## Code

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

add_filter( 'wpmu_active_signup', function ( $mode ) {
    if ( is_user_logged_in() || is_super_admin() ) {
        return $mode;
    }

    return 'all' === $mode ? 'user' : $mode; // Visitors may still create an account, but not a site.
} );
```

## Notes

Applies when Network Settings > Registration is set to allow both user accounts and sites. Super admins are never restricted.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Only Logged-In Members Can Create New Sites" 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/
