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

WPMU Functions/wpmu create blog


Creates a new blog (site).

This function runs when a user self-registers a new site as well as when a Super Admin creates a new site. Hook to 'wpmu_new_blog' for events that should affect all new sites.

On subdirectory installs, $domain is the same as the main site's domain, and the path is the subdirectory name (eg 'example.com' and '/blog1/'). On subdomain installs, $domain is the new subdomain + root domain (eg 'blog1.example.com'), and $path is '/'.

Uses: domain_exists() , insert_blog() , wp_install_defaults() , add_user_to_blog()


(string) (required) The domain of the new blog.
Default: None
(string) (required) The path of the new blog.
Default: None
(string) (required) The title of the new blog.
Default: None
(integer) (required) The user id of the user account who will be the blog admin.
Default: None
(object) (optional) Other meta information.
Default: [blank string]
(string) (optional) The site_id of the blog to be created.
Default: 1

Return Values

  • If successful, returns the id of the blog created
  • If fails returns a WP_Error object


<?php wpmu_create_blog($domain$path$title$user_id$meta$site_id); ?>