Is it even possible?
Every few months I hear the question, when talking about WordPress multisite, “Can you set it up so that each new site has all the same settings as the other ones?” What's surprising to me isn't the question. That's natural – especially if someone is thinking about setting up a network of sites. They don't just want to create sites, they'd like all their plugins configured, menus configured, all that good stuff.
No, it's not the question that gets me. It's often the answer I hear: “No, you can't do that,” or “No, each site gets its own settings,” or “No, that's one the things that's not possible yet.” It's surprising because the actual answer in many cases is “Yes, that's totally possible.” Like I heard a recent 19 year-old (Taylor Jasko) say at WordCamp Los Angeles: “I know, because I did it.”
To be clear, each site does get it's own settings. But that doesn't mean you can't preconfigure the process so that each new site matches a template (and becomes a clone). So the answer is yes, cloning WordPress sites is possible.
Defining the Problem
Let's imagine you've created a multisite network and every time a client pays you, you route them to a page where they can set up a site. Now, you, being the business person you are, know that the most important thing you can do for your customers, is to make it easy for them to manage their own site.
- So you want a customized admin interface (as a plugin – instructions here).
- You also created a series of custom post types that you want to make available to them (via the Custom Post Types plugin).
- Additionally, some of these custom post types require additional meta boxes (via the Advanced Custom Fields plugin).
- Lastly, you created a form that would go on each site (using another plugin called Gravity Forms).
You can see the challenge, right? You've just created an incredible site that you'd like all your customers to start with, but if the answer is that there's no way to clone your baseline, then what can you do?
Have you found yourself there?
A friend and I set out to help an organization that was going to be running a network of 400 sites (at least). And we wanted everything listed above – custom post types, custom metaboxes, post-creating forms by Gravity Forms, and a default menu that every site would have. Initially we thought we'd have to write a lot of custom code to make this happen.
We were wrong. A single plugin did all the work for us.
The plugin, however, is a premium plugin and you can get it by becoming a member at WPMU Dev. But when you compare the time it would take to custom code this thing, you'll soon discover it's worth it.
New Blog Templates
The plugin is called “New Blog Templates” and you can find it at WPMU Dev's site.
The process for using it is really simple.
- Create your default site. Mind you, it doesn't have to be the first site on your network. In our case, the first site was the customer-facing site.
- Configure the default site with all your plugins, plugin settings, menus, categories, tags, and more.
- Go into the Network Admin and go to Settings > Blog Templates.
- There, fill out the form (with the default site's ID) and then click “Create Blog Template”.
- In the Actions column of the page, click on “Make Default.”
Wait…there's more
Those five steps are almost everything you need to know. But there are a couple things you need to be aware of (and maybe this is why some think you can't do this cloning stuff). Some plugins (like Gravity Forms) have their own tables. To do this right, you'll need to replicate those tables for each install. So after you finished step 5, there is one other step to consider, if any of the plugins you're using create tables.
Step 6: In that same screen, click on the name of the template (first column). That will take you to the Advanced Options.
You can see that Gravity Forms has tables that start with “rg_”. So you click the check boxes and it will clone those tables for each site you create.
You're done…except…
At this point, you're ready to go…that is unless you use Gravity Forms. That's because Gravity Forms is a premium plugin that requires activation. Now, what if you don't want every one of your clients to have to activate Gravity Forms on their own? Guess what? There's a way to handle that as well – especially in a multisite network. You edit your wp-config file to have an entry where you can put your license key for all your sites. Then, when you network activate the plugin, each site will be activated with your license.
define(
"GF_LICENSE_KEY"
,
"YOUR-LICENSE-KEY-HERE"
);
Note: You must have a license that lets you create as many sites as you like.
Wasn't that Easy?
So, if my count is right, that was seven steps. Not bad and not a lot of work, if you use the right plugin.
Each site remains configurable after the fact – so clients can still go in and manipulate things. But you can keep your support costs low by making sure the sites all match and start in the same place.
Have you tried something like this? Was there something that didn't work? Let me know.