A WordPress Multisite Network is a way to host multiple WordPress sites on a single WordPress installation.
In this lesson, you will learn more about WordPress Multisite,
why you would consider setting up a Multisite Network,
and the steps to follow to create one.
A WordPress Multisite Network is a collection of WordPress sites that share a single WordPress installation.
With a Multisite Network, it's possible to allow users to create their own sites
or configure the network so that only administrators can create sites.
These are known as sub-sites or individual sites on the network.
All sites on a Multisite Network use the same WordPress installation files
and share the same plugins and themes.
Plugins and themes are installed on the network and then activated on individual sites.
Each individual site has separate directories for media uploads within the shared installation
and separate tables in the database for site content.
It is important to note that while they share the same core WordPress files,
the sites in a Multisite Network are separate from each other.
They are not interconnected like other kinds of networks.
If you plan on creating sites that are strongly interconnected, that share data or users,
then a Multisite Network might not be the best solution.
A Multisite Network is a good solution when you have a number of sites that are similar in nature
but need to be kept separate from each other.
Examples of this include higher education websites, nonprofit organizations, and open source projects.
One of the biggest examples of an active Multisite Network is the Make WordPress Network.
Here, each contributor team that works on the WordPress open source project
has its own sub-site that is part of the Make WordPress Network.
This means that if you are a member of, for example, the core team,
you can only log into the core sub-site and create content for that team.
The web host or local development environment you use will determine how you create a Multisite Network
either locally or on the live server.
The two common options are either to offer a setting that you enable during the new installation process,
to set up the new installation as a Multisite Network,
or to follow the manual steps to setting up the Multisite Network after WordPress is installed.
Web hosts and local development environments that use the Apache web server
generally allow you to convert an existing WordPress install into a Multisite Network using the manual method.
Those who use Nginx generally require you to create the Multisite Network during the new site creation process.
This is because by default Nginx doesn't support the .htaccess file that is used to enable the Multisite manually.
Whether you use a web host or local development environment that enables Multisite automatically or manually,
it's a good idea to understand the additional steps needed to create a Multisite Network from a WordPress install,
which is what this tutorial will focus on.
Before you create your Multisite Network, make sure to read the "Before you create a network" page in the developer documentation,
as it covers some important considerations you need to be aware of before you create the network.
Next, you should make a backup of the current site files and database.
This is not strictly necessary, especially if you've created a brand new WordPress install,
but it's a good idea if you've already created some content on the site that you want to turn into a Multisite.
Additionally, if you have a backup of the site files, you can quickly revert any changes you may create in the Multisite Network,
if anything goes wrong during the process.
At the same time, you should make sure that permalinks work on the site,
and that any active plugins installed are deactivated.
Finally, if you want to have your WordPress install running in its own directory,
make sure to do that before you create the Multisite Network.
To enable Multisite, you need to edit the wp-config file in the root directory of your WordPress install
and define the constant "wp-allow-multisite" as "true".
Inside the wp-config, scroll down to the section where it says "Add any custom values",
and we can copy an existing constant, change this to "wp-allow-multisite" and "true".
Then, refresh your WordPress dashboard.
By setting this constant, you'll now see a new menu item in the dashboard under the Tools menu called "Network Setup".
The Network Setup page will walk you through the steps to create your Multisite Network.
First, you'll need to choose whether you use subdomains of your top-level domain as addresses for the sites on the network
or subdirectories.
Subdirectories are easier as you don't require any additional DNS configuration,
but subdomains give the sites a more professional-looking URL.
To use subdomains, you'll need a wildcard DNS record for your top-level domain.
For the purpose of this tutorial, we'll be using subdirectories.
You can leave the rest of the settings as is or change them to your liking.
Once you're ready, click the Install button.
WordPress will now run the network installation, creating any database tables required
and adding any specific data needed to those tables.
Once the installation is complete, you'll need to enable the network.
This is done by making two changes.
Edit the wp-config file again and add the constants described at step 1 of the enabling the network page in the dashboard,
and edit the hdaccess file in the root directory of your WordPress install
and add the rules described in step 2 of the enabling the network page.
Let's start by copying the constants.
We can just add those underneath the allow_multisite constant.
Then let's copy the rewrite rules.
And we will put them inside the hdaccess file, overwriting all the existing rewrite rules.
Once you've made these changes, refresh your WordPress dashboard.
You will be asked to log in again.
You will be redirected back to the network setup page.
But you will notice that you are now logged in as the network admin,
and you have a different set of menu options for your newly created multisite network.
For more details on how to create a multisite network,
make sure to read the Create a Network page in the official WordPress documentation.