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.
Opens WPIDE on
Code
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 add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.