WordPress

Managing Multiple Sites with WordPress Network

By | | Programming | WordPress

Here you are, a web developer currently working on several different WordPress sites at varying stages of development. They’re all in different directories on your domain so clients can have a look and see how they’re coming along. Out of nowhere, a major new WordPress version is released, and the Genesis framework you’re using to build all your sites needs to be updated.

Managing all your WordPress installations at a times like this can be a real hassle. This may not be your exact story, but I’m sure many of you can sympathize.

WordPress Network comes to the rescue in situations like this. Once you’ve set it up, you can put multiple sites in directories and subdomains with the click of a button. Since they all share the same WP installation you can update and edit them all in one fell swoop from your Network Admin dashboard.

Before you start, unless this is a brand new WordPress installation with nothing to lose, you’ll probably want to back up your database and files. You also need to disable any active plugins. You can start them back up after the network setup is complete.

Now for the nuts and bolts of creating a new WordPress Network.

First you’ll need to enable Multisite. Use your FTP client or web server’s file browser and download a file called wp-config.php and save it to your desktop or a folder. Open it with your text editor and add this line above where it says "/* That's all, stop editing! Happy blogging. */".

define('WP_ALLOW_MULTISITE', true);

Save the file and upload it back to the server. Since the original wp-config.php is still there, it will ask you which file you want to keep. Choose “replace” or “overwrite” to save the newer, edited version.

You’ll need to refresh your admin panel in your browser to let these changes take effect.

In your Tools menu in the left sidebar, you’ll now see the Network Setup item. Click on that and then go to Create a Network of WordPress Sites. Follow the directions and choose a few options such as the URL structure and network name.

You’ll then be prompted to make a blogs.dir directory in /wp-content and it will provide several more lines of code to add to the wp-config.php file.

It will also tell you to add some rules to .htaccess, a server text file used to work with permissions and configurations for each directory.

Use your FTP program of choice to download this file. You may need to tell your FTP program not to hide this file, which you should be able to specify in the program’s options or preferences.

Even when you have downloaded the file, you may find your operating system’s file manager hides the file from you, so here are some directions for how to show it.

Mac

Open Terminal, found in Applications/Utilities.

Type/paste in this and hit return/enter:

defaults write com.apple.finder AppleShowAllFiles -bool true

Finder must be restarted to allow this to take effect. In Terminal paste in this and hit enter:

killall Finder

When you’re done, if you’d like to hide hidden files again, use the same line as used to hide it, but change “true” at the end to “false” and restart Finder.

Windows

Press the Start menu. Click on Control Panel, Appearance and Personalization, and then Folder Options. Go to the View tab. Under Advanced Settings, select “Show hidden files and folders” and hit “OK“.

Once you have shown hidden files, open .htaccess and add the code given by WordPress Network Setup, save the file and re-upload it.

It is possible that this file has not already been placed on your website. If, after setting your FTP program to display hidden files, you still don’t see the .htaccess file in your website’s root public directory, you’ll need to create a new one.

Create a new file in your text editor, paste in the code given by WordPress Network Setup, save that as .htaccess to your desktop or a folder, and upload it to the server, in the root public directory of your website.

When you log into the Network Admin, you’ll now see a “My Sites” item. Hover over that, and under “Network Admin”, there will be several administration items. When you click on “Sites”, you can add new sites with the click of a button!

Back under the main “My Sites” menu, you can manage all the network sites.

Setup is complete!

Now, with your WordPress network, updating and making changes to all your sites is simple and far less time-consuming.

Get Started with
Ruby on Rails

Github, Twitter and Hulu. All huge. All successful. All Rails.

Learn the web development framework of the moment with our newest book and course.

Learn Rails

Daniel Shamburger

Daniel is a freelance web designer and blogger from Texas. He enjoys developing sites from scratch, especially with WordPress.

More Posts - Website - Twitter

{ 19 comments }

sukago February 17, 2012 at 8:42 am

Hi Daniel,
I have a site built on wordpress. Now we plan to add ecommerce to it and I want to add store.example.com. Can I use wordpress network there and have two independent sites without affecting the original one.
Please let me know.
Sukago.

Daniel Shamburger February 19, 2012 at 5:22 pm

Yes, I believe that would work fine. For example I have my site at codechirps.com and a WordPress network installed at demo.codechirps.com to demo my themes. I just have one now, at demo.codechirps.com/codechirps.

You can just make the subdomain “store” through cPanel or whatever system your server uses.

Mowing February 21, 2012 at 8:44 pm

How safe is having ecommerce inside a Wordpress site?
I’ve heard it’s risky and that Wordpress is vulnerable to hackers.

Back to the article… I’m looking into WP multi myself (have 5 sites), but there seems to be a bit of work to set them all up. I have some good plugins (not too many), but they’ll require new data entry when re-activating.

Do you think multi will save a lot of time for me?

Still trying to get my head around it… but thanks for your article.
Do you have any video tutorials?

Phil February 2, 2012 at 2:51 pm

I moved to doing dev work on a mutisite, as it seemed like a great solutions to messy multiple installs and login creds. It also with domain mapping allows the creation of landing pages to be very convenient. However the first few sites that I had to move off onto their own install was a **real ** headache until I got the hang of it.

Uddhava January 28, 2012 at 2:45 am

One thing that isnt clear to me is the following;

Can this multisite feature be used to maintain WP installs that are remote, iow on differents servers spread around different isp’s? Or does this work locally only?

Daniel January 28, 2012 at 9:27 am

I’m afraid not. WordPress Network is only for multiple sites on the same domain.

Craig Buckler January 30, 2012 at 1:46 am

That’s not quite right. A WP network can manage any number of sites on different domains, sub-domains or paths. However, they must all reside on the same server.

Daniel January 30, 2012 at 9:56 pm

Really Craig? Sorry, I didn’t mean to provide false information.

How would one go about using a WordPress network on multiple domains?

Christophe February 2, 2012 at 1:08 pm

Hi Guys,

WP multisite can manage any number of sites on different domains, subs etc… using domain mapping plugin : http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

Joe Zim January 27, 2012 at 10:05 pm

I love using Multisite for Wordpress. The company I work for uses it quite often to group related client sites. Heck we even did the Packers Hall of Fame and each player in the hall of fame had their own website in the multisite, which made it MUCH easier to set them all up. (e.g. Gilbert Brown’s site)

Daniel January 28, 2012 at 9:28 am

Nice, that’s a terrific example of how useful a WP Network can be!

Steven January 27, 2012 at 2:36 am

Great article Daniel, we manage several company sites built on wordpress and I wasn’t aware of this feature previously.

kangtanto January 26, 2012 at 8:40 pm

Thank you for the explanation. I’ve been looking for such article to solve some problems on my wordpress site.

Blake Petersen January 26, 2012 at 5:22 pm

Great article, my company is planning on migrating all of our brand blogs over to Wordpress and this would be a perfect application for a Wordpress Network set-up.

Also, gotta love those Apple fanbois… So eager to validate their fanboidom… no surprise there! ;]

Nathan January 26, 2012 at 12:25 am

Wow, the windows instructions are a lot longer the the Mac instructions. No surprise there.

Daniel January 26, 2012 at 8:02 am

Well, no, actually the Mac instructions are a little longer. The Windows instructions are just that one paragraph and then after that it’s back to the WordPress Network installation instructions.

But in plenty of cases it is true that Windows computers require many more steps than a Mac in order to complete the same task.

Thanks for reading! ;)

Martyn Chamberlin January 28, 2012 at 2:05 pm

Lol, just goes to show how quickly people scan articles these days.

Great job Daniel! You’ve done a great job here.

Alex February 16, 2012 at 10:47 am

Apple is a blight on society.

Daniel Shamburger February 19, 2012 at 5:24 pm

Absolutely wrong there, my friend! ;)

They’re products are great, but the “fanbois” do resemble that remark.

Comments on this entry are closed.