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

Function Reference/insert blog


Store basic site info in the blogs table.

This function creates a row in the wp_blogs table and returns the new blog's ID. It is the first step in creating a new blog.


<?php insert_blog$domain$path$site_id ); ?>


(string) (required) The domain of the new site.
Default: None
(string) (required) The path of the new site.
Default: None
(int) (required) Unless you're running a multi-network install, be sure to set this value to 1.
Default: None

Return Values

The ID of the new row

Change Log

Since: MU

Source File

insert_blog() is located in wp-includes/ms-functions.php