Wordpress is awesome, right? Having themes, plugins, and a separate core makes it easy to manage or add new features to customize a website. But what about when you have a handful (or more) to manage? They all need the same urgent plugin update at once, or maybe you want to add a similar new feature to all of them.

Spend your time getting ahead, not just keeping up.

It is time to graduate to Wordpress Multisite. Merge all of your websites into one master wordpress. Then easily update them all at once. Ideal for multi-lingual sites, or simply subdividing content or portfolio companies so you can easily share domain name (or subdomains).

Step 1: Back Dat Thing Up

If you can afford to, always make another backup.

Since Wordpress can be anything to anyone, there are a lot of different options for backing up all of your site content. Having inherited many websites for clients over the years, I have seen a lot of different setups for hosting wordpress including: Linux, Mac, sub-sub-folders, hosted (like WP Engine), dedicated, shared, and even Windows machine.

You can definitely use any number of backup plugins, but the one process that seems to work almost universally can be done with a few strokes from the CLI (command line interface). (protip: check out VVV)

cd /path/to/wordpress/

mysqldump -u $dbuser -p $dbname > backup.sql

tar -cf ../backup.tar.gz -z . //Note: You can get database info from wp-config.php

Ta-Freaking-Da! Really, that got everything in your entire site. All your posts, uploads, settings, theme files, and anything else on your site and server (even the hidden .htaccess file). Now it’s portable, and you can copy or save it anywhere else.

Keep this handy in case you need to rollback. Which is easily done by reversing the last 2 steps: (expand the archive with tar -xf and import the database file with mysql $dbname < backup.sql).

Step 2: Setup a Wordpress Network

This is one of the most satisfying parts of it all, and really what makes the time your spending to create a central Wordpress multi-site a huge cost-saving for managing your websites.

Simply install the standard Wordpress setup using your preferred method. Things like WP CLI, Fantastico, or cPanel installer scripts will make this easy. Then to take it from just another Wordpress site to multisite, just add this one line:

//add to your wp-config.php

define( 'WP_ALLOW_MULTISITE', true );

Now login to WP-Admin and follow the steps. Obligatory RTFM

You’re gonna want to create a bucket under Sites for each of the websites you want to import. Feel free to get creative depending on your circumstances. For example, we setup our sites based on language, department, product lines, events, and landing pages.

We eat our own dogfood by using our digital asset management wordpress plugin to pull in images from our central content hub into all of our websites.

Step 3: Out With the Old

Again, use the option best suited to your skill level for getting your data out and back in. Plugins are great, but need to be researched and tested. For all things Wordpress, I try to use the native ways when possible. They tend to offer the most consistency and standard database logic.

I always export using the default Wordpress Export (Tools >> Export).

Definitely choose All Content. I thought this was less than ideal when all I wanted was Posts. But this is the easiest way to also get all metadata and most importantly, the media attachments and featured images.

If like me, you came up against some custom post types used for forms, or pages you don’t want to import, then you can get clever for exporting just want you need. Of course you could muck around with find/replace in text files. But I found it easy to duplicate the site in a staging environment, and then just disable themes, plugins and delete unwanted content prior to exporting All Content.

Repeat this process for all of your existing websites, and keep the exported .xml(s) easily accessible for the next step.

Step 4: In With the New

If you are successful in step 3, this one can be done in a matter of minutes. Of course it even took me a few tries to get it right, so don’t feel defeated if you have to take a step back and try again. For instance, one of the sites was using this outdated and unsupported multilingual plugin called qTranslate.

So I want to stress the importance of getting the export process to do all of the heavy lifting for you. If all goes well, you can simply cycle through your multi-site dashboards, and just use the Tools >> Import (Wordpress).

One great alternative for more complicated exports, is the amazing importer: WP All Import. It has a powerful drag-and-drop interface for mapping fields (including Advanced Custom Fields) from the .xml exports to any post fields. (RTFM)

Step 5: Go Live

Wordpress Multisite is pretty amazing, and you can be up and running using their default subfolder or subdomain setup. But the reality is that you are not limited to any standard convention. There are great tools to map custom domains in multisite.

This is why we love Wordpress after all, right? It can be anything for anyone.

Just be sure to manage your redirects (if the permalink structure is different) and be sure to let Google (and Bing) know by using their webmaster tools console.

Happy hacking :)