How to create sub site in wordpress multisite programmatically?

I have wordpress multisite created. Now I want to create a 10 sub sites automatic/programmatically. I have created one form and that form is uploaded on the same server. So once the user filled out that form and the subsite needs to be create automatic. If you have any article, plugin, code or script please help me.

Thank you in advance.

Topic multisite Wordpress

Category Web


With wpmu_create_blog() function, we can create subsites easily.

Add the following code in your form submit

wpmu_create_blog ( 'your_domain', '/subsite_path',  'Title of Subsite', '1' );

NB: if your site url is https://www.example.com then your_domain is should be example.com

Ref: https://www.krishaweb.com/how-to-programmatically-create-new-site-in-wordpress-multisite-within-60-minutes/

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.