# Minimum Site Name Length for Signups

> Requires new site names to be at least a set number of characters (WordPress only asks for four), cutting down on throwaway and squatted names.

- Type: PHP
- Runs: Run everywhere
- Category: [Multisite](https://wpide.com/library/category/multisite/)
- Tags: signup, site-names, validation
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/ms-min-site-name-length/

## Code

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

$wpide_min_length = 6; // Minimum characters.

add_filter( 'wpmu_validate_blog_signup', function ( $result ) use ( $wpide_min_length ) {
    if ( ! is_super_admin() && strlen( (string) $result['blogname'] ) < $wpide_min_length ) {
        $result['errors']->add( 'blogname', sprintf( 'Site names must be at least %d characters long.', $wpide_min_length ) );
    }

    return $result;
} );
```

## Notes

Change $wpide_min_length. Super admins creating sites are not restricted.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Minimum Site Name Length for Signups" 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/
