Create as many sites as you want in your network

How to Install & Setup WordPress Multisite

| 44 Comments

Since version 3.0, you have natively had the option to activate WordPress Multisite, which allows you to run as many sites as you want from a single WordPress installation (whereas previously it was one website per WordPress installation).

If you run a lot of sites, or you have lots of clients that you keep websites for, it can be a lot of maintenance to go to each one individually and update them on a regular basis.

With WordPress Multisite, you can update all the plugins and themes with just one click, which is a huge time-saver. I currently run a network of about 10 sites and it makes it so much easier to keep everything updated. You could have a much larger network of sites and it would be no more difficult to update them all.

The benefits of WordPress Multisite are massive and I thoroughly recommend it to anyone who wants to run more than one site, unless there’s good reason for keeping the sites separate from one another.

If you find this tutorial a little too daunting, you can always hire me to do it for you. If you’re comfortable fiddling with code, here’s how to do it…

Back up everything!

You’re about to be making some significant changes to your core files and in particular, your database, so be sure to take a thorough backup of both even if you automate your database backups.

Allow multisite installation

To avoid dangerous mistakes, you have to intentionally enable the option to even install multisite. Fortunately, it doesn’t require much of you. Hunt down your wp-config.php file which should be in the root of your WordPress installation, find the “stop editing” line and insert the following line just above it, like so:

Setup the network

Now when you refresh your WordPress admin, you’ll see an additional option under the Tools menu called Network Setup. Head there. You’ll be presented with a few options, like what to call your network and the email address of your Super Admin (see A Quick Guide to User Roles). You may also be presented with the option to choose between sub-directory or subdomain installation. Unless you desperately want a subdirectory installation, I would strongly suggest subdomain installation. Fill the options out and hit the big old install button (but only if you promise me that backed up your site first).

Enable the network

Now that your database is ready to get the network going, you need to edit a couple more files to make the network active. Fortunately, the clever WordPress monkeys made it very explicit and easy for you to understand.

After setting up the network, you should be presented with a page that shows you a few blocks of code. Enabling the network involves adding some code to two files: wp-config.php and .htaccess, both of which should be in your website’s root folder. The code for your wp-config.php will look something like the code below:

Add a wildcard subdomain

Subdomains in cPanelAt this point, you should also enable a “wildcard subdomain” in your hosting account, which will allow WordPress to use whatever subdomain it needs to create all the different sites. I’m going to show you how to do this in cPanel, since this should be available to most of you (especially if you use the awesome HostGator).

Once logged in to cPanel, hit the Subdomains icon. You’ll then have a small form that will enable you to add a new subdomain (above any subdomains that might already exist). Create a new subdomain of * on the domain of your WordPress master site, setting the document root as public_html, or wherever the root of your website is, if it’s not there.

Creating a Wildcard Subdomain in cPanel

Once you’ve successfully done that and added all the code that WordPress asks you to, you’ll need to login again. There should be a link at the bottom of the Network setup page. Click there and log back in, where your new multisite-enabled site will be waiting for you.

Tweaking your settings

How you set up your network will largely depend on how you want to run it. For example, on my network, I don’t want to allow anyone to be able to create their own site, though that is an option if you want to do that. I also don’t want to limit what kind of files can be uploaded (since I’m in charge of all the sites), or what size they can be, though if you have a more open network, you may want to put some of those restrictions in place.

Network Admin MenuTo modify your network settings, you’ll need to go to the newly created Network Admin area; your original WordPress site will continue to have it’s own admin area, but there will be a new overarching Network Admin Area where you can install themes, plugins and add new sites and users from. To access it, you can go to the admin bar and find it under the My Sites menu. You can also go to yourdomain.com/wp-admin/network to get to the Network Admin area.

Once you’re at the dashboard, you can find the network setup page under Settings > Network Settings. Just have a good look through at everything and set up the options as you see fit for what your network needs are. You can of course change them if they are too strict or lax in the future.

If you’re going to disable new site registrations, so that only a Super Admin can create new sites, you might want to add another declaration to your wp-config.php file, just below all the ones you pasted earlier. This will redirect people to a specified site if they try to access a site that doesn’t exist (presumably your master site). For example, since I have the following declaration in my wp-config.php file, anyone trying to access balloons.theukedge.com, which does not exist, will be redirected to The UK Edge:

Adding a new network site

Add New Network SiteNow that your network is all set up, you’ll probably want to add your first network site. Doing so is a fairly simple process. Go to the Add New option under the Sites menu in your Network Admin area.

The process of adding the site is incredibly simple. Just three pieces of information are required of you; the site address, which is where your site will be accessed from. For example, if I was going to create a site at parties.theukedge.com, I would simple insert parties in this field.

New Site AddedYou’re then asked for the Site Title and finally the Administrator’s email. If you want to add yourself as the site’s admin, just enter the same email address that you used in your existing profile. Alternatively, you can set it as someone completely new.

Once you click on Add Site, it will create the site for you and you are then given the option to go to the Dashboard, or Edit the Site. Simple huh!?

How about using custom domains for my new sites?

As you’ll have noticed, everything up to this point has allowed you to create new sites as subdomains to the Network Master Site, where you installed Multisite. But what if you want to use custom domains for your new sites? For example, I have WordPress Multisite installed on theukedge.com, but Do It With WordPress is a network site from that installation, even though it’s domain (doitwithwp.com) is not a subdomain of theukedge.com.

Well, I’ve written a tutorial that walks you through that process. If you’ve gotten this far, it’s only a small step to be able to use individual domains for your network sites. Go ahead and read How to Set Up Domain Mapping for WordPress Multisite.

Problems? Questions? Requests?

So, how did it go for you? Did you get it set up successfully? Do you have any questions that I didn’t cover in this tutorial? Or was there something that you need me to help you with? Let me know in the comments.

Categories: The Basics | Permalink

What next?

Hire me

If you couldn't quite manage this yourself, find it too intimidating, or just don't have the time to do it, you can always hire Dave to do it. Please get in touch so that we can discuss your needs.

Leave a comment

If you have a question, update, or comment about the tutorial, please leave a comment. I try and respond to every comment, though it may take a few days, so please check back soon.

Let a WordPress Expert help you

Do you want to try this, but feel like you need a helping hand, in case something goes wrong? My service, The WP Butler, gives you access to WordPress expertise whenever you need it. Better yet, I'll keep your site backed up, updated and secure, so that you don't have to worry about it. It's all part of the service. Use coupon DIWW and save 15% on all plans.

Visit The WP Butler

Author:

Dave has been tinkering with WordPress for many years, and he now shares his WordPress knowledge here on Do It WIth WordPress to help others realise its impressive power. He can also be hired to help with your WordPress needs. Dave, who is British, is married to his best friend, Marti, with whom he has a beautiful daughter, Ellie. When he's not dabbling with WordPress, he's probably eating Triscuits or hummus, watching an indie film or British TV show, spending time with friends or family, or exploring the world.

44 Comments

  1. Thank you for writing this, I am thinking about implementing this on my webserver. I use a combination of subdomains and domains all have separate directories and separate wordpress installations. Since I don’t update these websites that often, updating plugins and WordPress feels like a lot of work. I hope using multisite will be easier.

  2. Developers wanting to give this a try on their localhost can use MAMP Pro or even better, may want to try http://serverpress.com/news/getting-started-with-wordpress-multisite/

  3. Dave, you keep topping yourself! The topic of multiple sites has been a complete mystery to me. I actually set up a second site on a second domain but it has no plugins, etc. This gives me some hope of running more than one website.

  4. Valuable information thanks, will be trying this very soon for my personal site. And I have a client who has a site with two languages. I am rebuilding his site with WP and am trying to figure out what what the best way to implement a multi-language WP site is. I have a feeling multisite might be overkill ?

    • I had a client looking for a similar solution recently but they ended up abandoning. I wasn’t thinking of Multisite as much as I was going to search for a plugin which would give the users the option to use their language of choice. Let me know what you decide

      • Thanks, currently looking into plugins like WPML and qTranslate. I originally thought of just installing 2 separate WP installs with each its own DB. My clients site is very small so duplicating it wouldn’t be too much work. I also read something about WordPressMU.
        Sorry multi language is kind of off the original topic. Will let you know what I try anyways. Cheers Tony.

  5. Thank you for this post. Our company runs 3 WP sites and I have been looking at other multisite CMSs to make my life easier. This is the most detailed instructions I have read for setting up WP multisite. I will try this out first before moving on to a different CMS.

  6. Thanks for the tutorial which sounds just the sort of functionality I need. However, I have my website currently set up in the root directory of my home domain and I am unclear as to the effect on it if I set up Multisite. Will I lose the ‘master’ site at root or can the network cater for a hierarchy of sub-sites (perhaps this is where sub-directories come in over sub domains)?

    • Hi Dave,

      That’s perfect. When you enable multisite, your existing site will not change, but you will have the ability to create new sites on subdomains of the master site i.e. newsite1.mastersite.com and newsite2.mastersite.com. You can then use domain mapping to give them custom domains if you want. This is not a situation where you want to use subdirectory installations.

  7. HI Dave – I landed here looking for a reason why my domain mapping plugin wont work as per installation methods.

    It has not been made clear to me – Do you need to have multisite installed in order to access the domain mapping feature of wordpress??

    Great tutorial BTW.

    Mark

    • Hi Mark,

      Well, if you don’t have Multisite installed, then you don’t really need domain mapping because your WordPress installation can be installed on whatever domain you want. It only really comes into play when you have Multisite, because then you have subdomain installations on your main domain.

  8. Thanks Dave,

    that makes more sense now, I was thinking I had to domain map to the sub-directory where WP was installed, but all I have to do is copy the Index.php to the Root dir.

    It was outlined in this tutorial – http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    Which was handy.

    Thanks for clarification.

  9. Hi Dave, have an error coming up in multisite, (Fatal error: Call to undefined function wp_get_current_user() in /home/content/85/5810985/html/braids/wp-includes/capabilities.php on line 1187) I was told it may be my one of my plug-ins or I need to rename the folder, but wouldn’t it cause issues? Also I’m hosted with godaddy, they don’t allow subdomain but I don’t see an option in my network to do subdirectory / . HELP :) Please :)

    • I’m not sure what the issue is, but if your host won’t let you do subdomains, that’s just ridiculous and you need to move hosts! I recommend HostGator, whom I have been with for years. I would recommend moving before I would recommend a subdirectory installation (which can cause all sorts of problems), especially when it’s on a substandard host like GoDaddy.

  10. Howdy -

    I’ve been readin up on Mutli-site, but can’t seem to find out if it can do what I want.

    (I’m not too picky as to whether it creates new sub-doms, or new sub-dirs)…what I want is this…>>>

    Main site, We’ll call it “mainsite.com”

    So, user comes to mainsite.com, creates a new blog, but it’s basically a replica of the mainsite. I want every site to have the same home, about us, contact, privacy policy, and disclaimer pages.

    It’s going to be set up as sort of a MLM site, where all sites have the same layout(I’ll let them select a from a quite few themes I’ve made), but I want to have them all have the same overall main pages. (they can post whatever they wish on their individual blogs).

    The reason for this, I want newbies, to be able to start a new site, put a couple aff. links in a plug-in I have, choose a them, and have a new website up in a matter of minutes.

    Any way to make all MS sites have the same pages?

    • In short, yes, there is a way to create default content when a new site is set up. It’s not covered by this tutorial, but there is plenty of information on such tasks online. Search for “wordpress default content new site”. That should give you a good start.

  11. I have my network set up and the wildcard domain set up in cpanel, but, when I create a new site, I get an internal server error. I checked my subdomain manager and do not see the new subdomain that should have been created.

    Any ideas?

    • The subdomain won’t appear in your subdomain manager. WordPress doesn’t truly create a subdomain, but it builds them on the fly using the wildcard subdomain. Not sure what could be causing the server error though, unless your host doesn’t support wildcard subdomains (which some don’t).

  12. I setup WP multisite and started to migrate in former single blogs. It all works like a charm, until I also want to migrate in separate subfolders from the former site.

    Say that I have a singe WP install at mysite.com and it has two subfolders, called /downloads/ and /maps/. Those are not folder created by the regular WP install, but are folders I have manually created and uploded to my site via FTP.

    Now I want to transfer those folders too, and be able to reach them from WP multisite (where I’m using domain mapping plugin) so that I could once again reach them from mysite.com/downloads/

    How would I do that? To where do I upload the content, via ftp or in WP to make it accessible in mysite.com/downloads/ ?

    Thank you!

    • You’d put those folders in your root folder (the same place as your wp-content, wp-admin and wp-includes folders). Then you’ll be able to access to subfolders using any of the mapped domains.

      • Thank you for your reply.

        But what if I have single html pages and stuff inside those /download/ or /maps/ folders and want it to only be accessible at that specific blog, for correct affiliate tracking and such, is there no way to get it to be specific folders for just that site?

  13. Thanks for the instructions and the follow up posts. I too, was trying to make it work using addon domains on hostgator. Everything worked fine after removing the addon domains and recreating them as parked domains (the instructions did specify parked domains)

  14. Dave, Thanks for the wonderful tutorial.

    I have about 25-30 single WordPress sites and want to combine all into one big Multi-site.

    Just few questions:
    1) Does your tutorial work for already existing WordPress sites or it does it only work for setting up new sites?
    2) Do we lose any SEO when converting old single sites into one multi-site?

    Thanks,
    Mike

    • Mike,

      Absolutely. By using the Export/Import feature, you can bring existing blogs into your multisite installation. Also, since you can map domains, assuming you keep the same permalink structure (or provide a 301 redirect if you change it), you will retain all of your SEO.

  15. I am currently looking at the ManageWP program that was developed. Have you heard of this, and if so what are your thoughts on this?? Is MultiSite comparable to ManageWP??

    I work for a company that has over a 100 websites and most of these websites have alot of the exact same pages. I am wanting a way to control these page through a master template, so that way if I ever have to add/edit any of these pages I can do it just one time.

    The tricky part is the fact that all I am wanting is to have the actual page content of the master template appear on each site, as each site will have a different theme and stylesheet that will style the content of these pages.

    I hope all this is understandable and I appreciate any feedback that you might have. Great article and I look forward to hearing from you.

    • Matt,

      If you want the pages to all have the same content, then Multisite will not make that any easier. As far as content goes, the sites are all distinct. They just share the same plugins and themes. So unless you incorporated the content into your theme files, which isn’t really ideal, but do-able nonetheless, then multisite won’t make that any easier. I have worked a little with ManageWP, but I don’t know if it will make this task any easier. It could be that you can publish new content to a variety of your sites, but I would think that editing the same page across all sites would not be something that is supported.

  16. This post coupled with the domain mapping post are two of the best WordPress posts online. Thank you for detailing this process so well!

  17. Hi Dave.

    I have successfully created a multi-site in the past (using sub-directories, not sub-domains), but this time, while updating my own site (currently in development and not yet migrated up to root level at http://www.designdxm.com/WordPress) I have run across a problem; I cannot access the network dashboard (My Sites>Network Admin>Dashboard…or >Sites, >Users, or >Visit Network). When I click on the link, I receive an “Error establishing a database connection” message. Is this a redirect problem (non-www to www), a table problem in the database, or what? I’m currently working with WordPress 3.5.1.

    Thanks,

    Steve

    • I think the main issue is that you cannot use subdomains from within a subdirectory without some additional rewrite rules. I’ve never needed to do this, so I’m not sure how to achieve it. If at all possible, I’d move it to the root directory now, or install on a test domain, and then move everything once it’s ready and change the URLs.

      • Hi Dave. I would think that this would not be an uncommon situation, as there must be plenty of situations when an existing (non-WordPress) html-based, bilingual site is being replaced with a WordPress bilingual site.

        I’m primarily a designer, so I’m learning on the fly here with all of the php and MySQL considerations.

        My first-ever WordPress site was a 60+ page multi-site behemoth with a primary site and three additional sub-sites (www.axsera.com). As far as I know, I didn’t do anything differently when setting up that site–and it works fine. The only differences between that one and this one were that I used a different theme, and I was on WordPress 3.5 at the time.

        I suppose my best bet is to install the site on a test domain, since I already have my current, html site running at the root level on my web host’s server. I’m also going to check the wp-config.php and .htaccess files on the http://www.axsera.com site to see if I can pick up anything there that I missed with this installation.

        I could also deconstruct the multisite and start over. I guess I’ll have to figure that one out on my own… I just don’t understand why this seemingly is a unique situation. I can’t help feeling that there is something obvious that I’m missing.

        Thanks for your time Dave.

  18. Hi thanks for your guid
    I did all of these steps,but i cant active my subdomain. first i had a blank page and now when i want to login to wp-login of my subdomain, i recive 500 Internal Server Error.what sholud i do?

  19. Hello Dave,

    i have the WordPress network installed and I managed to have an English and a French site working correctly. The problem is that both websites have the English language on the pages. How can I get my French site pages to be in French?

    All of my searches end up in advice on changing the language in the dashboard of the subdomain, but I don’t have that option (drop-down box showing available languages) in my admin of the French site, nor in the English site.

    I do have the ‘fr_FR’ and the ‘en_US’ languages.installed in my domain/wp-content/themes/mystile/lang folder…

    Need help as I’m not much of a nerd… :(

  20. Dave,
    Fantastic! One question though, I set the ‘NOBLOGREDIRECT’ line in wp-config, but instead of just redirecting potentially non-existent multi-sites, all non-existent pages are redirecting that way instead of dishing out a 404.

    How would I distinguish between the two?

    Thanks!

  21. Dave,

    Perfect. Thanks a ton for the great tut and checking in regularly on this older post! Much appreciated.

  22. Hi there, recently choose to make a wp multisite for my company (hosting in godaddy) and all went well in the first day of installation.after that i have problem with my control panel of each subdomain of site i used. for your info i used subdomains in directory as the hosting provider says that i cant use subdomains with wildcards (*.mydomain.com – only mydomain.com/sub).So I m geeting all the time internal error.
    Any help?
    Regards George

    • Well, either you are using wrong terminology, or you’re trying to set it up very weird. If you’re going with a subdirectory, then there are no subdomains to speak of, yet you mentioned subdomains several times…

Leave a Reply