Learn how to do a wordpress multisite installation

How to add multisite for your wordpress installation in a few steps

Doing the wordpress multisite installation is fairly easy.  It only consist on a few steps and if you’re clear on what you’re doing it should be as straight forward as installing wordpress from scratch… even easier!

Step 1: Allow Multisite

The first step to take to create the wordpress multisite installation is to add the following line on your wp-config.php

/* Multisite */
define('WP_ALLOW_MULTISITE', true);

This line will tell wordpress that you want to add multisite functionalities to your blog/site.   Amazingly wordpress comes with all the needed functions to handle multisite so there’s no need to add aditional files or folders, not even the need to configure the database.  The wordpress multisite installation will use the exact same database you have configured for your wordpress adding new tables as you add sites.

wordpress multisite installation
wordpress multisite installation

It is important to place this line just RIGHT AFTER the /*  That’s all, stop editing! Happy blogging. */   This is because at the end of the file there are some directory configuration that should stay last.

After you’re done adding this line, you will see a new item under TOOLS called “Network Setup“.  Click on this new item and you will get a screen to configure you new network:

Allow Multisite wordpress install
Allow Multisite wordpress install

 

Create a network - Multisite WordPress Installation
Create a network – Multisite WordPress Installation

This screen will let you set the NAME of your network.  Don’t worry about this, you can always change it after.  Also it will ask you to set the primary email address for your network.

After you click INSTALL, the network will be created and you will have to do the most important change on your wordpress configuration: modifying the htaccess and wp-config.php:


Network Settings - WordPress Multisite install
Network Settings – WordPress Multisite install

Step 2: Modify htaccess and wp-config.php

Now that you have installed your network, you can enter into your network to finish the installation. You will see a “Network Setup” screen where you will find the code you will need to copy under your htaccess and wp-config files.

Network Setup - WordPress Multisite install
Network Setup – WordPress Multisite install

It is very important to replace the old wordpress code inside your .htaccess file with this new one.   the code you will need to replace is normally presented on this way:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

This code will set your install to read on the base URL ( / ) and activate the wp-admin for all sites under the same network.  You can see the lines with [_0-9a-zA-Z-]+/ , these are the ones allowing your sites dashboards to be accessible using wp-admin.

You will also need to place the code on wp-config.php to let wordpress you’re using a multisite.  This code will look like this:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'mysite.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

This is letting wordpress know you want a multisite, with no subdomain install, pointing to the domain ‘mysite.com’ to the / root path and having the site number 1 as the primary site.

After you do this you will need to log out and log in again.  This will activate all multisite configurations on your site and then you will be able to fully navigate the multisite menu:


my sites new tab - wordpress multisite install
my sites new tab – wordpress multisite install

First you will see a My Sites new tab on the top bar.  This is for a quick access to all the sites you will create.

Secondly, you will notice that the menu on the wordpress multisite network is a simple list of the following:

  • Sites: This is were all your sites are listed
  • Users: All users to all sites (each site will have its own users)
  • Themes: All themes available for the sites
  • Plugins: All plugins available for the sites
  • Settings: This is the network settings page, not the regular site settings page
  • Updates: If any update available it can be made from the network dashboard, no need to update plugins and themes for each site individially

Let’s start by adding a new site and then let’s configure some plugins and themes

Step 3: Configuring the network

The first item on the network dashboard menu is the SITES one.  Here you can add as many sites you want and WordPress will automatically install the new database tables and set the configuration.   Then you can access this site as it was a normal wordpress site and start configuring it.

sites configuration - wordpress multisite install
sites configuration – wordpress multisite install

If you want to install new themes you can do it as normally you would do it by going to Install Themes on the network dashboard:

installing a new theme - WordPress Multisite install
installing a new theme – WordPress Multisite install

It is important to know that after installing the theme, you need to click on ‘network activate’ to have the theme available for all sites.

But also, after clicking ‘network activate’ you need to go to the specific site where you want that theme to be activated, go to Appearance and click on ‘activate’.

It is mandatory to do these two activations if you want to see a specific theme on a site.  This is because the first activation makes the theme available to all sites, and the second activation directly activates the theme for that specific site.

Now if you want to add a plugin there’s an important consideration to be aware of:  when you install the plugin you SHOULD NOT click on ‘network activate’, otherwise you’re activating the plugin for ALL SITES and this could cause problems.  See the ‘network activate’ option on the following screenshot:

installing plugins - WordPress Multisite install
installing plugins – WordPress Multisite install

I know the semantic is the same, but in the plugins scenario, network activating a plugin will run automatically the plugin on every site under your network… you don’t want that.

You want to go to the specific site and ‘Activate’ the plugin for that only and only one site.

Adding users is also a little bit different on a WordPress Multisite installation.  First you will create the new user by setting an username and the email, but you will not get the option to set a password.   The multisite will automatically send the password to the users email so he can login and configure his account:


users configuration - WordPress Multisite install
users configuration – WordPress Multisite install

 

adding a new user - WordPress Multisite install
adding a new user – WordPress Multisite install

If you want to create an user and also set the password, you will first need to add him and them go to the users menu and find his name, click on it and you will get into the regular default users wordpress page, where you can set a new password for this user.

Considerations if you’re installing a multi-language site:

There’s a great plugin that you can use called “Multisite Language Switcher” that will help you integrate the post, pages, categories and tags for many sites.

multisite language switcher plugin
multisite language switcher plugin

After you install the plugin on your sites, go and activate it on the sites you want it to affect (remember to never ‘network activate’ a plugin).

The plugin will auto detect how many sites on your network have the plugin activated and will read the language of these sites.  You can then start configuring it to help you get the relationships between posts categories, etc.  You will see a box like the one up here that will allow you to link post between each other.

After you learn how to do a WordPress Multisite Installation you will be able of doing it many times and have your pages super charged with all the benefits of multiple sites on one same domain.

Leave a Reply