WordPress Multisite guide for newbies
We have been writing some posts in order to illustrate some of the most important aspects about the use of WordPress in an easy to understand way and today we want to continue with this and go inside one of the most important capabilities of WordPress: the creation of networks or multiple sites under WordPress multi-site. We will talk about what it is, Will clarify some terms related to creation of multi-site installations, and we will go into some steps to be able to set it up. We hope you find this interesting. It has become a very important tool for bloggers but even more important for businesses running over WordPress, companies and institutions with a lot of information to publish. Take a look into this post, you will probably learn something you didn't knew.
What is it?WordPress Multi-site or MS, formerly Multi-Users or MU, is a way to run multiple WordPress sites under a single installation. In the past there were two versions of WordPress, one for single sites active since 2003 and other one for multi-site installations since 2007. As of the release of WordPress 3.0, in 2010 MU (multi-user or multi-site) is no longer a separate project and is included under regular WordPress releases, which is a good thing because ensures that there will be more frequent updates as they promise on their page. The several ways to call WordPress multisite that can be found on the internet can cause a little of confusion but they can be explained. Multiuser or MU, refers to what it was the project in the past, when WordPress was only for blogging, and the project allowed the creation of multiple users accounts for blogging, and the entire installation was defined as a site. Multi-Site or MS, refers to what is the project now that WordPress is more than a blogging tool, what users can create on demand are now defined as sites and the entire installation is now defined as a network. The fact that multiple sites run under a single installation means that you will only need to download one copy of the software and all the information will be stored in one database. Every site of the installation can however, use a different theme, different plugins, and different users with different roles, and even the posts, categories, and tags in every blog are separated from other information in any other site of the network. so although everything is under one installation, it can be pretty much well divided.
Who is using itThere are a lot of schools, universities, medium and large companies and, organizations of all genres taking advantage of WordPress multisite's benefits all over the world; even individuals that handle large personal infrastructures are using it. Some famous networks powered by WordPress Multi-Site are:
Comedy.comComedy.com is a web portal featuring the funniest images, videos, and lists every week. Comedy.com uses WordPress multisite to pull the best content from its blogs to the homepage.
BBC AmericaBBC America is a channel that shows both Britain and American shows. Every show has its own site, and each site, its own child theme.
NY times blogs.The NY times is one of the most important newspapers, it features through WordPress multisite more than sixty blogs covering all themes of interest such as politics, business, technology and more.
BestBuyBestBuy uses WordPress multisite to power more than a thousand sites, one for a different store in the U.S. allowing the associates to blog about the events and other news, as well as the store location and other info.
EdublogsEdublogs is a site that currently powers more than a million and a half blogs, in a secure way, with no advertising, used for well known entities such as the Stanford and Cornell Universities.
Multisite ConceptsNow, we are going enter in details with some terms that a referent to WordPress MU. These are concepts that you should understand to be able to manage your network without confusion.
NetworkFor WordPress multisite, the word network does not imply that things are connected between them like they usually are in other kind of networks. The word network refers to a group of sites created under a single installation, This is the only thing that differentiates them from single installation sites. The concept of multisiste is very similar to blogs hosted at WordPress.com. Since users can create their sites on demand, although you can create a network where only you, the administrator can create sites.
Subdirectory, Subdomain and Stand-Alone domain.Aspects of the network very important to have in mind specially if your goal is to have a multi-site installation to run several sites like for example a blog or portfolio hosting site, but your knowledge about networking is low or none. Below, the URL formats for each one of them:
- Subdirectory: https://yourdomain.com/mynewsite
- Subdomain: https://mynewsite.yourdomain.com
- Stand-alone domain: https://yourdomain.com
Domain MappingIs the process of pointing a domain name (www.mysite.com) or even multiple domain names to a primary hosting account. Most of the hosting service providers offer this service and you should check with them to know how to go with it. Domain mapping helps converting a subdomain or subdirectory address into a stand alone one, which helps you to define a particular name for the site over the default one given when you create it. So it lets you hide the fact that your sites are part of a single multi-site network If you are planning to make multiple domains to point to an unique hosting account, or to change the domain name of a website, you might need to have some knowledge of this.
A and CNAME recordsThe main DNS records of a domain of a website are known as A records. when a website is set for the domain name, there is at least an A record that associates the website with an IP address or internet protocol. When you get a hosting service, the host assigns an IP address to your site. A records are also set with subdomains, this is done when the site admin wants to have the subdomain name pointing to an IP address different from the main domain’s one. given this if typing mynewsite.yourdomain.com, it is redirected to yourdomain.com if you own the main domain. DNS system will always redirect people entering mynewsite.yourdomain.com to yourdomain.com CNAME, or canonical name records are resource records used in Domain Name system, its purpose is to serve as an alias for the name assigned in the A record, so every record has a CNAME record and the host name from the A record. now using the example URLs, mynewsite is the alias and yourdomain.com is the host name. With this setting visitors entering mynewsite.yourdomain.com are redirected to the main page yourdomain.com.
Some Pros and Cons of WordPress MultisiteNaturally, the use of tools like this implies pros and cons of use, let's check them.
- only one installation folder on your server,
- possibility to add your existing sites to the network
- share themes plugins plugins and updates to all sites with one install
- only one database to maintain
- Total independence among the sites created.
- only super admin can install themes and plugins
- understanding admin roles, and the multisite mode in general, can be confusing.
- if something goes wrong, all sites will be affected. if an update goes wrong , all sites will be affected and will be crucial to perform opportune backups.
- If your server or hosting fails, all your sites will go down
Uses of WordPress MultisiteIn the case you are thinking on creating a site that will host lots of users, in example a social network or a blogging site Also can be used if the idea is to create a site for a company, organization or entity that generates huge amounts of content or is divided in several departments. In example, the ones below could install and make good use of it
- Universities: Universities have several faculties and departments that handle several projects, and recently universities provide every student an account into the site. Reason why putting all together in a single site can make navigation sometimes extremely hard. And creating a network becomes the solution
- Large companies: There are several cases of companies using WordPress multi-site in an intranet to create an organized network and effectively provide content to the different departments and allow account creation for every member of each one of them.
- Schools: In the same way as an university, just at a smaller range.
- Blog hosting projects: In an example, Its a growing tendency to create social networks for specific social groups. let's illustrate it with a fictional site https://iamamusician.com which is a social network for musicians that allows site creation on demand. Just like Facebook would do.
- People with several sites: having a multisite installation makes really easier to manage multiple sites since you do not have to log into each one of them to apply changes
How to activate WordPress MultisiteBefore proceeding with the installation, you need to think about the way you want your network to be set up (subfolders, subdirectories). And of course, you need to prepare your server for MU. Depending on your case, or if you feel uncomfortable with following these steps, you will need to contact your web host or a professional to complete these steps since you might need some previous knowledge about the WordPress and server environments. We include in the next section some important steps for you to follow in order to get your server ready for a MU installation, as well as a video with simplified instructions to install MU. However, we highly recommend you to visit the very well detailed WordPress codex documentation to create a network since errors may occur at any moment and you will probably have to walk back on your tracks to find the error and you will need to know what you are doing to avoid worse things to happen.
mod_rewriteThis is a step that needs to be applied on the Apache files on your server. Apache is a software that is loaded and running on your Web server. But not everyone has access to Apache files. Usually, the person who has access to those files is the Web server administrator (your web host). Depending on your account and configuration, you may not have access to these files, so ask if you are unsure. The Apache module that’s necessary in order for the WordPress Network to create nice permalink URLs is called mod_rewrite. It must be configured so that it’s active and installed on your server. You or your Web host can make sure that the Apache mod_rewrite is activated on your server; open the httpd.conf file and verify that the following line is included within: [code]LoadModule rewrite_module /libexec/mod_rewrite.so[/code] If not included, type that order on its own line and save the file. You will probably need to restart Apache for the changes to take effect.
Virtual HostIn the same httpd.conf file, you need to make some adjustments to the <VirtualHost> section of that file. Follow these steps:
- Find the <VirtualHost> section in the httpd.conf file.
- This line of the httpd.conf file provides directives, or configurations, that apply to your Web site.
- Find a line in the <VirtualHost> section of the httpd.conf that looks like this:[code]AllowOverride None[/code]
- Replace that line with this line:[code]AllowOverride FileInfo Options[/code]
- On a new line, type[code]ServerAlias *.yourdomain.com.[/code]
- Replace yourdomain.com with whatever your domain is. This line defines the host name for your Network site and is essential for the virtual host to work correctly.
- Save the httpd.conf file and close it.
PHPNow you have to edit the PHP configuration on your Web server. PHP needs to have the following configurations in place in the php.ini file on your Web server in order to run WordPress MU on your server: Set your PHP to not display any error messages in the visitor’s browser window Find out if your PHP is compiled with memory limit checks by looking for the text memory_limit in the php.ini file. Usually, the default limit is 8MB. Increase the memory limit to at least 32MB, or even 64MB, to avoid PHP memory errors when running WordPress MU. Set global variables to Off by opening the .htaccess file that can be found on your Web server in the same directory you installed the WordPress MU files, and add the following two lines in the very top of the .htaccess file: [code]php_flag register_globals 0 php_flag display_errors 0[/code]
WordPressTo enable the Network, you must define multisite in the
wp-config.phpfile. Open up wpconfig.php and add this line above where it says /* That's all, stop editing! Happy blogging. */. or if this line does not exist, insert it above the first line that begins with require or include: [code]define('WP_ALLOW_MULTISITE', true);[/code] You will need to refresh your browser to continue. Then go to administration> tools > network setup and follow the steps which are a couple of simple copy and paste tasks, that once done, will let your WordPress site convert into a network. This video explains the installation process in a really simple way.
Moving sites into a multisite installationOne of the key advantages of WordPress multisite is the one that allows to add active sites to the new installation. this has been a very helpful tool for a lot of admins that before upgrading to the multisite version of WordPress already managed one or multiple sites and did not want to lose the database. Although there is a video below showing the process to make it as simple as possible, it is better to continue with the following process if the expertise with managing server files is enough to be comfortable with the process and understand each step.
- Make backup(s) of the site(s): Though it can be a little tedious, it is highly recommended to make a backup of the site(s) so, in the case something goes wrong, you can rely in your backup most importantly the destination blog. WordPress.org offers instructions to back up your database using several methods. and your installation offers the option to export your content information such as posts, pages, comments, custom fields, categories, and tags through the admin bar menu> Tools> export. back up can be done also by putting the info of the WordPress folder in a zipped file.
- Create a new site in the multisite installation: using the option add site on the multisite dashboard, making sure that important plugins are available in the new installation. The latest WordPress version should be used to make the process as smooth as possible.
- Transfer media files from one installation to the other one: these are the files uploaded to wp-content/uploads
- Transfer the database: you can either use the import method, and import the XML database created previously with the export method, this method can be sometimes a failure due to PHP limits. The other option is to copy the database using phpMyAdmin menu or SQL commands.
- Activate the site: activating the site may require you to use a new URL or to change the old folder name if you don’t want to have the old installation to be appear when someone uses that address.
- Restore the widgets and plugins: the widgets options saved in the old database should be copied because these are not exported.