I want to create a website where new registered users have their own website. The new site have to have content and some options activated of my template. I'm using Customizr, it's great.

I've not get change the initial options by default of Customizr yet. So I've thought about making an automatic copy of my template with the registration data (subdomain name, username, etc.) every time a user registers.

I think NS clone has an add on for that but I'm not sure. Also, I'd prefer to do it manually.

Does anyone know how to do it?

  • I have done this once, but need to search my plugin. Basically it was a so called dummy page called /default and on new blog creation it copied all options from there.
    – seot
    Aug 30, 2018 at 16:57

2 Answers 2


Finally I'll use Multisite Cloner. This is not supported but it works fine.


I automated https://wordpress.org/plugins/blog-copier/ to solve this issue. If you just want to do it manually take this plugin otherwise here is my automated version:

include "BlogCopierExtended.php";

add_action("wpmu_activate_blog", "blog_copy",15,3);

function blog_copy($blog_id)

    //  first I save the options I want to preserve
    $customer_name = get_blog_option($blog_id, "customer_name");

    // get the customized class
    $blog_copier = new BlogCopierExtended();

    // the default blog, from where to copy the data from
    $default_blog = get_id_from_blogname( "default" );

    // copy this
    $copy_now = $blog_copier->copy_blog_to_existing($blog_id, "", "", $default_blog, true);

    // now we save the values back
    update_blog_option($blog_id, "customer_name", $customer_name);


and the Blog Copier extended class is this

if (class_exists('BlogCopier')) {
    class BlogCopierExtended extends BlogCopier

        public function copy_blog_to_existing($blog_id, $domain, $title, $from_blog_id = 0, $copy_files = true)
            global $wpdb, $current_site, $base;
            $email = get_blog_option($from_blog_id, 'admin_email');
            $user_id = email_exists(sanitize_email($email));
            if (!$user_id) {

                // Use current user instead

                $user_id = get_current_user_id();

            // The user id of the user that will become the blog admin of the new blog.

            $user_id = apply_filters('copy_blog_user_id', $user_id, $from_blog_id);
            if (is_subdomain_install()) {
                $newdomain = $domain . "." . $current_site->domain;
                $path = $base;
            else {
                $newdomain = $current_site->domain;
                $path = trailingslashit($base) . trailingslashit($domain);

            // The new domain that will be created for the destination blog.

            $newdomain = apply_filters('copy_blog_domain', $newdomain, $domain);

            // The new path that will be created for the destination blog.

            $path = apply_filters('copy_blog_path', $path, $domain);

            // $to_blog_id = get_current_blog_id();

            $to_blog_id = $blog_id;
            if (!is_wp_error($to_blog_id)) {
                $dashboard_blog = get_dashboard_blog();
                if (!is_super_admin() && get_user_option('primary_blog', $user_id) == $dashboard_blog->blog_id) update_user_option($user_id, 'primary_blog', $to_blog_id, true);

                // now copy

                if ($from_blog_id) {
                    $this->copy_blog_data($from_blog_id, $to_blog_id);
                    if ($copy_files) {
                        $this->copy_blog_files($from_blog_id, $to_blog_id);
                        $this->replace_content_urls($from_blog_id, $to_blog_id);

                    $msg = sprintf(__('Copied: %s in %s seconds', $this->_domain) , '<a href="http://' . $newdomain . '" target="_blank">' . $title . '</a>', number_format_i18n(timer_stop()));

                    // do_action( 'log', __( 'Copy Complete!', $this->_domain ), $this->_domain, $msg );
                    //                  do_action( 'copy_blog_complete', $from_blog_id, $to_blog_id );

            else {
                $msg = $to_blog_id->get_error_message();

            return $msg;

Something like this is the way to go

  • seot, thank you very much for answer so fast. I've installed Blog Copier and I have inserted your code in the functions of my template, removing the first line, but it seems that it doesn't recognize get_id_from_blogname. I'm modifying it a bit. When I have something, I will write again.
    – Nanosergio
    Aug 31, 2018 at 18:45
  • Hi, get_id_from_blogname works fine. I put the slug of the blog wrong. I'm sorry to ask you for more help but this would save me. I've installed and activated Blog Copier, then I've copied your code in functions.php of my template, without the include call. I created a Demo 01 site with my personalization options. I've replaced "default" with "demo-01" in your code. Then I registered a new user and a new site from the main site (localhost / wp-signup.php) but it doesn't have the options of the site Demo 01. I don't know what is the problem. Surely it is silly but I need to solve it.
    – Nanosergio
    Aug 31, 2018 at 21:41
  • blog copier should transfer everything, but might be some customizer options are somewhere in the database its not recgonizing anymore
    – seot
    Sep 1, 2018 at 14:24
  • find them in the database nd copy them thru $wpdb
    – seot
    Sep 1, 2018 at 14:26
  • I've tried it with other template (Twenty Seventeen) but it doesn't work. Blog copier may not work with the latest version of wordpress (4.9.8). Anyway, I'm very grateful for your interest and suggestions. If you get a fix, please tell me. You already have a friend forever :)
    – Nanosergio
    Sep 2, 2018 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.