WordPress

How do I create a multi-user site in WordPress?

This tutorial explains how to create a Multi-User site in WordPress.

A MultiSite allows you to create different sites and manage them from a unique dashboard. This is useful, for example, if you want a development environment or if you want to create different sites for each language. For example, you can create an English (left to right) site in your root domain or under the /en subdirectory and a different right to left (Hebrew or Arabic) site under /il or /sa subdirectories. Additionally to subdirectories, the MultiSite feature also allows you to create sites under subdomains.

All steps described in this tutorial include screenshots, making it easy for all WordPress to apply them.

Preparing WordPress for MultiSite:

Before creating a WordPress, MultiSite, let’s disable all plugins and define friendly permalinks.

To begin, login to your WordPress dashboard, and on the left menu, place your mouse pointer over Plugins and press Installed Plugins as shown in the screenshot below.

In the Bulk dropdown menu, select the Deactivate option (Black arrow), then select all Plugins (Red arrow) and press the Apply button (Blue arrow) to disable all plugins.

Now let’s define friendly permalinks. To do it, place your mouse pointer over Settings and then press Permalinks (Settings>Permalinks).

Scroll down the permalinks screen and choose a friendly structure. You can select the Post name option, as shown in the image below.

Now we are ready to begin. Before continuing with the steps on the dashboard, we need to enable the MultiSite feature in the wp-config.php file located in the server, as explained in the next section of this tutorial.

Note: Don’t close the dashboard; use new tabs.

Enabling and creating MultiSite in WordPress:

Now we need to enable the MultiSite feature. This must be done on the server; you can access your server using your FTP of choice, Cpanel, Plesk, or any hosting manager.

Note: Don’t close the dashboard; use new tabs.

In case you are using an FTP client, just connect to your site and on the root directory of your site, follow those steps.

If you use Cpanel, find the File Manager and press it on the main screen.

Find the file named wp-config.php, right-click it and press Edit.

When requested confirmation, as shown below, press the Edit button.

Find the line “/* Add any custom values between this line and the “stop editing line. */” and paste the following code line below it, as shown in the screenshot below. Then press the Save Changes button on the upper right corner.

Note: If you are using an FTP client, download the wp-config.php file, edit it as explained in this section and upload it back to your server.

define( 'WP_ALLOW_MULTISITE', true );

Note: Don’t close the Cpanel tab in your browser.

After copying the code line in the proper location and saving changes, go back to the WordPress dashboard and refresh the page.

You will realize a new option is available under the Tools section of the dashboard left menu. The option Network Setup, press it (Tools>Network Setup).

The two first options in the Network Setup screen are the following:

  • Sub-domains: As the description says, this is the option if you want your additional sites to be shown as subdomains, for example, site1.YourDomain.com, site2.YourDomain.com, etc.
  • Sub-directories: The subdirectories option will show your sites as subdirectories like YourDomain.com/site1, YourDomain.com/site2, etc.

I will choose subdirectories for this tutorial, which is better for SEO over subdomains. Feel free to select the option of your preference.

Below define a Network title, an arbitrary field to identify the network containing all your sites. Also, fill out the Network Admin Email field.

Then press the Install button.

The next screen will provide you with two codes, a code to add to your wp-config.php file and another code to add to the .htaccess file, both of them located in your server.

First, copy the code in the upper box to add to the wp-config.php file and open the Cpanel tab or the FTP client, depending on what you are using.

Note: Don’t close the dashboard; use new tabs instead.

Note: It is highly recommended to backup our wp-config.php file before continuing.

If you are using Cpanel, right-click the wp-config.php file and press the Edit option.

If you are using an FTP client, download the wp-config.php file again.

If using Cpanel, a confirmation request will show up; if that’s the case, press the Edit button.

Paste the code we previously copied from the dashboard (The upper code to add to the wp-config.php file), just above the line /* That’s all, stop editing! Happy publishing. */, as shown below.

After pasting the code, press the Save Changes button (upper right corner).

Go back to the dashboard and copy the code in the lower box, to add it to the .htaccess file.

Note: Don’t close the dashboard; use new tabs instead.

In case you are using Cpanel, and you don’t see your .htaccess file in the server, press the Settings button located in the right upper corner as shown below.

Make sure the Show Hidden Files (dotfiles) is selected and press the Save button.

Note: Before continuing, it is recommended to backup the current .htaccess file.

If you are using Cpanel, right-click the wp-config.php file and press the Edit option.

If you are using an FTP client, download the .htaccess file to your computer.

In the .htaccess file, remove all content between the lines # BEGIN WordPress and # END WordPress; you can leave the comments (The lines starting with #) remove the rest between the mentioned lines.

Now, paste the code you copied from the lower section of your WordPress dashboard, between the lines # BEGIN WordPress and # END WordPress. We are replacing the code you removed in the previous step with the code provided by WordPress for the .htaccess file.

Once the code has been pasted, press the Save Changes button.

After copying the code and saving changes, go back to your dashboard to continue the installation by pressing the Log In the link below the codes you copied in previous steps.

Login to your WordPress dashboard.

Now you will see an icon with three homes (My Sites) in the upper left corner, as shown in the screenshot below. Press it.

When pressing My Sites, a menu will be displayed; press the Network Admin option and then press Sites as shown below (My sites>Network Admin>Sites).

You will see your current site, the main site where you installed the MultiSite.

To add a new site, press the Add New button.

Type your new site URL or subdirectory, the site title, language, and admin email. In my case, I defined linuxhint as a subdirectory, but if you are doing this to add additional languages, you can define /es, /il, /ru, /cn, etc.

Then press the Add Site button.

After adding the site, the screen will refresh but will remain, allowing you to add another site; you can repeat this operation to add more sites.

After adding your site(s), on the dashboard left menu, press Sites and All Sites (Sites>All Sites).

Now you can see a preview of your basic installation by pressing the Visit link. To access your second site dashboard, press the Dashboard link.

That’s how to create a MultiSite in WordPress.

Conclusion:

As you can see, although creating a MultiSite in WordPress isn’t a short task, it is easy to implement. All WordPress users with access to the server files can do it by following the steps described above. The MultiSite feature is excellent for web developers and multi-language websites, among other usages. This allows you to backup and restores your sites separately. I hope this tutorial was useful.

Thank you for reading this WordPress tutorial explaining how to create a MultiSite in WordPress. Keep following us for more WordPress professional articles.

About the author

David Adams

David Adams is a System Admin and writer that is focused on open source technologies, security software, and computer systems.