Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/wpmu validate blog signup


Validates the passed blog name and title against set criteria (listed below).


(string) (required) The blog name to be validated.
Default: None
(string) (required) The blog title to be validated.
Default: None
(object) (optional) Purpose unknown at present.
Default: [blank string]


Blog name

The function validates that the blog name...

  • Is not already in use
  • Is at least 4 characters long
  • Is not empty
  • Is lowercase
  • Is alphanumeric (contains numbers and letters)
    • It cannot be numeric only (is not only numbers)
    • Does not contain an underscore (the "_" character)
  • Does not contain illegal names defined in Site Admin -> Options
    Defaults: "www", "web", "root", "admin", "main", "invite", "administrator"

Blog title

The function validates that the blog title...

  • Is not empty

Return Values

Instance of WP_Error with error codes and messages inside.


<?php wpmu_validate_blog_signup($blogname$blog_title$user); ?>


To validate the blog name and title, you would use the following:


// The URL given to the new blog e.g. newblog.domain.com or  domain.com/newblog
$blog_name    'newblog';

// The title given to the new blog
$blog_title 'New Blog';

$result wpmu_validate_blog_signup($blog_name$blog_title);