Create new site via php script with template…?

(sorry if this is a duplicate. The submission seems to have stalled so I tried a second time)

I use a php script to import some csv data into my multisite config.

Occasionally, I get data that requires a new site to be created via

Can you give me a line or two (or several if necessary) to create a new

site using a template I have previously defined as “new site rollout”?

For example, if Im creating a new site via the admin panel, I go to

and fill out the data, then select my “new site rollout” template. The

new site is created via the template and Im good to go.

I need to do this in a script via php.

Something like


$templateName = “new site rollout”;

wpmu_create_new_site ($siteAddress, $siteTitle, $adminEmail,



I would think its something along those lines…


— E