Get $500+ of the best After Effects files, video templates and music for only $20!
Using WordPress Multisite: A Network of Websites at Your Fingertips

Using WordPress Multisite: A Network of Websites at Your Fingertips

Tutorial Details
  • Program: WordPress MS (aka Multisite or WordPress MU)
  • Difficulty: Beginner to Intermediate
  • Estimated Completion Time: 15+ minutes

Today, we will look at the basics of WordPress MS – or for those users that have been using WordPress for a while – Multisite or WordPress MU. WordPress MS is a feature that many users are unaware of, and one that is often confusing to install and configure. But no more! In this tutorial, we will walk through installing WordPress MS, becoming familiar with the network admin, and integrating useful plugins for your Multisite network.


Introduction

WordPress Multisite is a feature that since WordPress version 3 has been included discreetly right into the install itself. It is a feature that packs a huge punch, allowing 1000s of blogs to exist virtually within one, single WordPress install. It is a great idea for large-scale sites that use multiple sub-domains, blog networks, social networks, or even internal networking for businesses or organizations. While this feature has been around for almost as long as WordPress itself, it is just now getting the attention it deserves – even from WordPress devs.


What We Will Do

In this tutorial we will:

  • take an in-depth look at WordPress MS (aka Multisite or WordPress MU)
  • install WordPress MS and learn about the different installation options
  • create new sites with MS
  • look at some useful plugins to combine with WordPress MS
  • examine projects that could benefit from MS

By the end of this tutorial series, you should be extremely familiar with what WordPress MS is, how to install it, how to create new sites, and how to use it most effectively for your next project.


What Exactly is WordPress MS?

In a nutshell, Multisite enables a single WordPress install to act like a network of sites centered around a single domain (http://yoursite.com). It allows for either new sub-domains (http://subdomain.yoursite.com) or sub-directories (http://yoursite.com/subdomain), and it does all this virtually, which means you do not need to create new folders. Instead, by just adding some code to wp-config.php and .htaccess, you have thousands of sites right at your fingertips.

Multisite also allows for easy network management through a single admin dashboard which a user with appropriate permissions can access via any network site’s admin bar. Multisite is by no means “new”. It has been around for almost as long as WordPress itself, although previously it was developed separately. Since WP 3.0 it has been included together with WordPress, and, as I mentioned above, it seems like it will only get more user-friendly as the WordPress devs seem to be paying some particular attention to it in 2012.

Next, let’s look at installing Multisite on a typical WordPress install.


Installing WordPress Multisite

For many people, installing Multisite can be a nightmare. I hope to alleviate that by taking you step-by-step through both a sub-directory and sub-domain install. Let me say first, that it is by far easier to install Multisite on a new install, even though it is still possible to do it on an older install with pre-existing content. However, there could possibly be permalink issues.

With that said, the following steps assume that you have completed a standard install of WordPress. However, the steps can apply to a new or previous install.

Activating the Network Setup Menu Item

In order to even begin the process of installing Multisite, you need to open your wp-config.php file, and right above

/* That's all, stop editing! Happy blogging. */

add the following:

/** Allow Multisite **/

define('WP_ALLOW_MULTISITE', true);

The first line simply is a comment that will help us keep our code tidy. Next, we tell our WordPress install to allow Multisite functionality. Once you have edited and saved the file, you should now see the following in your “Tools” submenu:

If you are using a previous WordPress install with active plugins, you will get a notice in Network Setup to deactivate all of your plugins before you continue.

Configuring the Network from the Dashboard

The first screen in “Network Setup” will look like this:

From this screen, you have the following items to configure:

  • Site Addresses – From here you will select whether to use sub-domains or sub-directories. If you choose to work with sub-domains, you should verify with your host if it is possible.
  • Network Title – The title for your network.
  • Admin E-Mail Address – The admin contact for your new network.

The server address should already be filled in to display how your new permalinks will appear.

If this is a pre-existing install, you will receive a note saying that only sub-domains are possible due to possible permalink conflicts. If you are installing on a localhost, you will only be allowed to install via sub-directories.

After you have configured these settings, click install, and you should see the following screen:

Finishing the Multisite Install

Now, let’s look step-by-step at the instructions given on the “Enabling the Network” page. Before you dig into this, I would strongly suggest that you backup your wp-config.php and .htaccess files. This will save a lot of headache in the future.

  1. Create a new directory named blogs.dir, and place that in your root folder’s wp-content folder. This folder must be writable by the web server, as it will be used to store all of our network’s uploaded media.
  2. Add the following code for a subdomain install:

    	define( 'SUBDOMAIN_INSTALL', true );
    	$base = '/';
    	define( 'DOMAIN_CURRENT_SITE', 'yoursite.com' );
    	define( 'PATH_CURRENT_SITE', '/' );
    	define( 'SITE_ID_CURRENT_SITE', 1 );
    	define( 'BLOG_ID_CURRENT_SITE', 1 );
    	

    and this for a sub-directory install

    	define( 'MULTISITE', true );
    	define( 'SUBDOMAIN_INSTALL', false );
    	$base = '/';
    	define( 'DOMAIN_CURRENT_SITE', 'yoursite.com' );
    	define( 'PATH_CURRENT_SITE', '/' );
    	define( 'SITE_ID_CURRENT_SITE', 1 );
    	define( 'BLOG_ID_CURRENT_SITE', 1 );
    	

    to wp-config.php right above:

    	/* That's all, stop editing! Happy blogging. */
    	

    Make sure to change yoursite.com to the URL of your site – make sure it is without WWW. Broken down, this code identifies this as a sub-domain or sub-directory install, and sets your main site’s ID as 1. Every site has an ID, and it is important to note these as you start to work with plugins and build custom queries.

  3. Add the authentication keys provided to wp-config.php. This will help secure your install.
  4. Finally, you want to add the following code to your .htaccess file:

    		RewriteEngine On
    		RewriteBase /
    		RewriteRule ^index\.php$ - [L]
    
    		# uploaded files
    		RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    		RewriteCond %{REQUEST_FILENAME} -f [OR]
    		RewriteCond %{REQUEST_FILENAME} -d
    		RewriteRule ^ - [L]
    		RewriteRule . index.php [L]
    	

    This code will replace any other WordPress code that you find in .htaccess.

For another reference on setting up a WordPress Multisite network, be sure to visit the “Create a Network of WordPress Sites” page in the Codex.

Things to Note with Multisite Installs

  • Multisite is easiest to install on a fresh WordPress install with the sites as sub-directories. That isn’t to say don’t install it any other way, just to point out the easiest path.
  • If you use Multisite, then you can not give WordPress it’s own folder. It must be installed in the root folder of your site.
    Editor’s Note: This is not 100% correct, for further information and clarification, see Andrea_R’s comment below.
  • Your web host may not allow for the creation of sub-domains. Be sure to check this out before attempting a sub-domain install.
  • You must activate the network feature from the WordPress dashboard. Simply adding the code to wp-config.php and .htaccess is not enough.

Navigating the Network Admin

In order to access the Multisite admin dashboard in WordPress 3.0 and later, simply hover over My Sites in the admin bar at the top of the browser window, and click on Network Admin.

Once in the dashboard, the menu looks like this:

The Network Admin menu has the following submenus:

  • Sites – From here you can create new network sites, visit admin dashboards, delete sites, and edit site settings.
  • Users – This submenu allows you to manage users by creating, editing, and deleting them. You can also see which users have registered on specific sites.
  • Themes – With Multisite, themes are managed from the network. Themes must be installed, activated, and edited from within the network admin dashboard. They can still be switched in the site dashboard.
  • Plugins – Just like themes, plugins are installed and activated on the network from this dashboard. Plugins can still be activated and set up in the site dashboard.
  • Settings – This submenu lets you set the network name, admin email, registration settings, welcome emails, initial site settings, and upload settings. This is a great submenu to configure if you are using Multisite as a blog engine or social network.
  • Updates – From this submenu, you can do network-wide updates on WordPress core, plugins, and themes.

Next, I want to walk you through creating your first network site. If you are familiar with using WordPress, everything else should seem pretty normal, with the exception of having to go through a network dashboard to activate plugins and themes instead of a normal site dashboard.

Creating a New Site

  1. From the network dashboard, navigate to Sites –> Add New.
  2. Next, you will need to specify the site address, site title, and an admin email. The screen will look like this:
  3. Once added, you will see a message at the top verifying the site’s creation. You can now visit the site’s dashboard, or edit the site’s settings from the network dashboard. Two emails will also be sent. Once will go to the network’s overall admin notifying them of the new site, and one will go to the site’s new admin, notifying them of their login credentials.

And that’s how easy creating sites can be in WordPress MS! Now, let’s look at some plugins.


Indispensable Plugins for WordPress MS

Here is a list of some plugins that I suggest using on MS installs, and, as always, if you have others to add throw them in!

  • WordPress MU Sitewide Tags Pages

    This plugin allows you to create a specific blog on the network where ALL recent posts on the network can be found. From within the plugin, you can also specify this to be on the main site that you set up in the initial Multisite install. The max number of posts to display can be set as well.

  • Multipost MU / ThreeWP Broadcast

    This plugin allows users that create content on different blogs to "broadcast" their posts to other blogs on the network. In addition to post content, categories, tags, and custom fields can also be broadcasted. To ease publishing to multiple blogs, blog groups can be created.

  • More Privacy Options

    This plugin allows you to set the privacy level of each blog from within the network dashboard site’s settings panel. The options are:

  • Domain Mapping

    This plugin allows users to use their own domain names on your Multisite network. This plugin does require a knowledge of adding and editing plugin files and a basic understanding of how servers work and your specific server settings. A great tutorial for setting up this plugin can be found on Otto’s blog, “WordPress 3.0 Multisite Domain Mapping Tutorial“.

  • Multisite User Management

    This plugin allows admins to set the default role of each, individual network blog. Once activated, a list of blogs appears on the network settings page. This plugin is different than the New Blog Defaults plugin, as it targets the individual sites as opposed to every new blog. For instance, if you want one site to allow all default users editor capabilities and another to have subscriber capabilities, then this is the plugin you are looking for.

  • New Blog Defaults

    This plugin creates defaults for any new blog created on the network. Once activated, a new menu appears under the network Settings submenu. From here, you can edit any of the normal WordPress settings: general blog settings, reading settings, writing settings, permalink settings, discussion settings, privacy settings, and media settings. You can also choose a site’s default theme, and set other options like categories, links, and initial user settings.

  • Extended Super Admins

    This plugin allows for the creation of specific user classes with specific roles. The plugin, once activated, can be found under the main network Settings submenu. The capabilities list is extensive.


Projects that Could Benefit from WordPress MS

Now that I’ve outlined how to install Multisite, how to create new sites, and what plugins to use, I thought it would be great to put some ideas down about possible projects that could benefit from Multisite. As always, if you have other ideas or Multisite installs that you’ve worked with before, feel free to add them in the comments.

  • Blog networks
  • Social networks
  • Internal networks for organizations or companies
  • Educational sites
  • Sites that span cities, customer groups, or other various groups
  • Any other WP site that may need the option for multiple sites within one install

Conclusion

This year holds some exciting things for Multisite, and as more and more users discover how to implement it, this currently under-used feature could soon become one of the core features WordPress is known and used for. I hope that you have learned how to install Multisite, how to navigate the network admin, and how to find plugins that can improve the functionality of your networks. Overall, I hope that you feel more comfortable using Multisite in your projects, and that, if you’ve never used it, you’ll take the plunge and play around with it.

Thanks for reading!

Add Comment

Discussion 35 Comments

  1. Hello,
    Great tutorial. Can I install WordPress MS on one domain, and a child site on another? It must be on the same hosts, or it`s not possible and this MS is just for subfolders and subdomains?

    • Michael says:

      They need to be on the same host, it’s only for subfolders and sub domains.

      To anyone reading this looking at a multi-site installation I would recommend the Diamond Multi-Site Widget for pulling post and content from subfolders/sub domains into the main installation. The Sitewide Tags plug in gave me a ton problems and didn’t seem to be 3.0 ready yet.

    • Hi Florescu Adrian,

      When you install WordPress MS on one domain you can definitely have a different domain for a child site. Although at the time you create the site it will be either a Subfolder (if you chose subfolders) or a sub-domain (if you chose sub-domains). However with the MU Domain Mapping Plugin you can map (or attach) a different domain for that site.
      Plugin found here:
      http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

      I am working for an advertising company that has a network of agencies across the world and we are building their sites, they all fit into the template that was built for us and now every-time I create a new site I map a domain to that site and they are in their own domain. This is very helpful because it means that you can control a lot of websites from one central location.

      I hope this helps you

    • Ruturaaj says:

      Yes, you can map a Domain name to your child site. You cannot separate the child site from parent site as both share same database, just different set of tables in that Database. So, if I’ve followed your query correctly, both Parent as well as Child sites will always be on same Host.

  2. Jaysone says:

    For localhost development, is there a workaround to installing multisite as a subdomain?

    • Ruturaaj says:

      Yes… as I know, we need to edit Apache configuration file to add support Sub-Domains. I’m not sure how to do this with any other LocalHost setup.

    • Japh Thomson says:
      Staff

      As Ruturaaj has said, you can achieve this with a local development setup, but usually this requires manual setup for each sub-domain rather than the automated process you have on a production server.

  3. Ruturaaj says:

    Well, most part of this tutorial is already there at WordPress Codex.

    http://codex.wordpress.org/Create_A_Network

    It could have been much more interesting if the Author explain the database structure of WordPress MU as compared with plain WordPress. Except last two sections, almost every other line is already well explained at WordPress Codex.

    For those who are interested in knowing how WordPress MU works, I suggest you to go ahead and create a WordPress MU installation on your LocalHost; create a new site and observe the database… it’s truly interesting to study the database structure of WordPress MU. Each time you create a new site, a basic set of tables (which is same as plain WordPress with, as I remember, a few extra fields in a couple of tables) gets added to your WordPress Database… your blog-name and ID of newly created site being the prefix of that table-name. This ID stuff proves very important to locate the folder equivalent to the “uploads” folder of plain WordPress in WordPress MU. Writing plugins and widgets for WordPress MU is another worth learning experience.

    Without taking away the due credit for taking effort and writing this tutorial, I request the Author to explore Wordperss MU more by the Programmer’s perspective than User’s perspective. Please don’t make “wp-tuts+” a site for WordPress Users… let it be a source purely maintained by the programmers for the programmers. Let there be a pre-requisite of certain experience level for readers to avail the information on “wp-tuts” website; I see no harm if they wish to gather more information from somewhere else and come back to this site well prepared to understand the text better than before. I’m not sure if this goes in tune with the purpose, motive and philosophy behind starting this website; but personally I would really like to see authors on wp-tuts to maintain it as a valuable resource for WordPress Coders/Programmers.

    • Sorry Ruturaaj,

      But I gotta say I am truly against such thoughts on making WP Tuts+ where a certain amount of experience is a pre-requisite. As may be aware not everyone is at your level and you are trying to get a site to basically cater for you rather than a large audience, eventhough all of this is on WordPress Codex let me tell you if I had a tutorial like this when I first had to install a WordPress MS it would have greatly improved my work and I would not have made the same mistakes I made. WordPress Codex is good but it has it’s limitations and sometimes not easy to understand. Where as with WP Tuts+ people like me that love WordPress and want to learn more about it can go from a beginner level of difficulty to an advanced level. Hence why each of the tutorials on WP Tuts+ and any other Tuts+ Website has a difficulty tag at the beginning of each tutorial.
      The Tuts+ sites are known for their diversity of helpful tutorials for beginners and webmasters alike let’s not make this an area for people with experience only as it would mean many of the users that come to WP Tuts+ would not be interested in coming here anymore.

    • Japh Thomson says:
      Staff

      Hi Ruturaaj, thank you for your feedback and especially for your comments on WordPress Multisite.

      Here at Wptuts+ we hope to have a mixture of articles, tutorials, and quick tips that are aimed at various levels of WordPress users. Some will be aimed at programmers / developers, and others will be aimed and people who’s just discovered WordPress, and everything in between! This way, we can all learn from each other and help each other at the various levels too.

      If you’re experienced and you read an article aimed at beginners, pitch in with comments to help explain or answer further questions that might come up :)

      Thanks again for reading!

      • Xander says:

        @ Staff & Author: I think you both should really stop drinking.
        People who want to start using multisite wordpress setups ARE NOT BEGINNERS!
        People who want to use multisite are able to find a way through the codex.

        Ruturaaj is right as right can be.

        • Japh Thomson says:
          Staff

          Thanks for your input, Xander. I can think of several groups of people, off the top of my head, who would like a beginner’s overview of WordPress Multisite and would find the WordPress Codex unapproachable.

          For example, it’s not only the people who implement these solutions that want to know how they work. Sometimes business owners like to get a basic overview to know what options and technologies are available to them, sometimes managers who haven’t been hands-on in a while like to get a basic overview to have a better understanding when discussing these things with their team.

          Don’t forget, there’s always more than one perspective on these things :)

        • Eric says:

          Uhmmmm,
          I am a beginner… just over from e107 that has nothing like it. Now I have to build a site with three subsites [car dealer with three car brands] and i just tried an multi site install on an existing wp install in a subfolder, and didn’t get that to work.
          So yes, extensive manuals with code samples are highly appreciated.

        • sapere_aude says:

          As for the comment that a beginner would not be using multisite I have to disagree. Anyone planning a site and services they might offer will most likely come across this option when they are forced to choose between installing WP in the root folder or otherwise. A quick check on google will then reveal that there is such an option for a reason. Then the beginner may start thinking about their site goals and how the structure they start with could affect them down the line. Some people like to understand their options and plan before they do anything.

          As for multiple articles on the same or similar topic to that on the WordPress site or any other… something to consider is sometimes comprehension is enhanced when words are composed differently or when information is simplified which is especially useful to the newbie. With anything completely new, information may seem impossible to understand until enough articles are read to drive the point home. Clarity takes time for some. Thank you for the article.

          I have yet to see an article that explains step one — if I can install WP without multisite into the root folder as it needs and then install my theme, child theme and plugins can I easily change this basic setup later over to multisite if I want to expand by adding subdomains?

          I would also like to know if it is possible to setup multisite so that each site uses its own MySQL database rather than combining everything into one.

    • Ruturaaj says:

      @Vitor & Japh: I appreciate your comments and views. I also appreciate to create and maintain tutorial websites for beginners; how can I forget the fact that I was also a beginner one day and I couldn’t have come this far without resources targeted for Beginners. I just found this tutorial quite redundant as compared with the content available at WordPress Codex.

      Japh, Good if you’re willing to target everyone, but still… please make sure you don’t get into the competition with other tutorial sites thereby simply striving for increasing the “number of tutorials available on this website”. Let others run their sites in their own sites; let’s give preference to quality than quantity here on wp-tuts. Believe me, I’m saying all this because I love this site & admire the people behind this website; don’t take it as criticism.

      Anyway. In view of the comment posted by Japh, let’s say and I accept that “wp-tuts+” is for all and not just for programmers. Either be the case, “wp-tuts” is an excellent initiative and I wish to say thanks & good luck to every single creative person behind this fine information resource.

      Japh, no worries mate; I will surely contribute to this site if I really find I’m having something good and worth to share here with my all other experienced and creative fellow wp-tuts readers/contributors. :-)

  4. Jermaine says:

    I use multisite for housing different portfolio samples, its works pretty neat combined with custom post and custom meta box i think im doing pretty well.

    • Ruturaaj says:

      Nice!! I use WordPress multi-site for Theme development. I’ve installed it as Test Bench on my Localhost. When I see a prospect to continue theme development work even after delivering it to client, I create new site for the new Theme… this way, I preserve the widget placements and other design aspects. Plus, this allows me to fill in the dummy data in database thereby exporting the content for my Theme users to import it as start-up data and setup my theme to quickly achieve “as seen in preview” look-n-feel. Since each site has its own database structure and plugins, I can continue developing each theme without any need to switch between Themes and also without disturbing the Widgets placed in theme-specific widget areas. So far, it’s going well for me and I can happily say my new Widget/Plugin/Theme supports WordPress Multisite right from the word go. :-)

  5. Steveorevo says:

    ServerPress.com’s DesktopServer Premium is XAMPP optimized for WordPress. You can create sub-domain and domain mapping aliases on your localhost easily to build out an entire Multisite configuration.

    http://serverpress.com/news/getting-started-with-wordpress-multisite/

  6. Andrea_R says:

    “If you use Multisite, then you can not give WordPress it’s own folder. It must be installed in the root folder of your site.”

    Minor corrections, as this is a point of confusions for many people.

    You CAN install multisite in a folders, like if you wanted it to reside in a subdomain, for instance. The path will always be part of the subsites addresses however. The other catch is domain mapping checks for this and refuses to work since the path will be in the mapped domains. (Subdomains are fine though.)

    You CANNOT put the WordPress files in a folder and have index.php in the root and enable multisite.

  7. To save anyone using 1and1 from a lot of headaches, you cannot choose the sub-domain option.

  8. Torbjorn says:

    Thanks for a great article. Very informative. It would be great to have a follow up with a usecase and in depth solution to that case.
    I have a question about multisite. I have a install where i want to create the users myself and i dont want WordPress to send out the email with username and password to a new user.
    How can i disable this? Is it possible to use a hook? Examplecode?

  9. Anand Kumar says:

    I have a question? Which is better in terms of server resources??

    Having 3 WordPress install for 3 different blogs
    or 1 WordPress MU for 3 different blogs?

    I almost use same plugin throughout the sites but different child themes. Using genesis framework.. Just want to save some server resources..

  10. I used WordPress Multisite for my theme catalog demo for show my clients. Also It’s very useful for mutiple theme development.
    Thanks for article.

  11. Elroy says:

    I need some help, I tried putting the code in my wordpress site and ntwork setting i not showing up on my dashboad, pls help me.

  12. Eric says:

    Reading that it IS possible to change an existing site [deactivated all plugins] and also have it in a folder [i.e. not directly in a root], I changed the wp-config.php.
    But the changes did not show up in the dashboard. The name of the folder is wp_eric… does this have anything to do that the multisite is not working?

    Thanks,
    Eric

    • Eric says:

      OK, I have a clean install under ROOT, but still it will not work. My Hosting co. tells me they allow subdomains and should work OK…
      Please help…
      http://www.bamboobalibonaire.eu

      Eric

      • Eric says:

        OK I found it ! ! !
        I copied the line from your text above…
        See how the define line shows curly quotes….
        Linux doesn’t like them…
        Can you please change them for straight single quotes…
        That will help a lot of NOOBs like me from looking why things don’t work…

        Thanks,

        Eric

  13. Laura says:

    Thank you for the article. This is a perfect tool for a number of projects. I’m at a “new level” — but with tutorials that help to get things functionally active, everyone’s an expert as soon as something works. :)

    Once I can get it to work, it’s an expert end result.

    I’m going to subscribe to this because I like how things were laid out clearly. Not everyone can teach and set things forth sequentially in an easily understood manner. (Not that everything was perfectly clear to me. But, it’s like cooking. Just follow the recipe. Nothing is too challenging when simple directions are given.)

    I think you did a great job.

    Laura

  14. Yvan D says:

    I am a teacher wishing to show my students how to create web sites with WP. I want them to learn how to install plugins, widgets, create and modify posts and articles, create links, play with the CSS styles and so on.

    To do all those things I am wondering if I should use the Multisite feature or simply create new installations in separate folders.

    Any input will be appreciated. Thanks.

    Yvan

  15. Jow K says:

    So does this mean that I only need to pay for one domain name and I can have multiple independent (appearing) sites

  16. Juan says:

    Hello,

    I find one big problem with multisite installations if you are not using subdomains: the /blog/ slug added in the main site. Does anybody know how to get rid of it?

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.