WordPress Multisite – A Beginner’s Guide – Part 3

If you missed our last two blogs WP Multisite Guide Part 1 and WP Multisite Guide Part 2  on WP multisite, don’t worry- this guide will get you up to speed. In the previous blogs, we discussed the basics and pros/cons of using a WordPress multisite feature. If you’re considering implementing a multisite for yourself, read on to find out how easy it is to install!

1. Prepare to switch to Multisite.

Before you set up a multisite network, use the listed criteria above to make sure you need one. If everything looks good, go ahead and check the following:

Back up your files and deactivate all plugins if you have an existing WordPress site. If not, install WordPress now.

2. Edit wp-config.php.

You’ll need to take the following steps to switch to Multisite: first, add some code to your wp-config.php file. You can access your WordPress core files by using FTP or opening your file manager; after that, simply open wp-config.php.

In this file, scroll down to the line that says:

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

 

Just above this line, paste the following code:

/* Multisite */ define( ‘WP_ALLOW_MULTISITE’, true );

 

Save the file, then restart your browser.

3. Set up a network.

You will see a difference in your WordPress dashboard after adding the code above to wp-config.php.

If you want your network to be based on subdomains, go to Tools > Network Setup in your dashboard and select “subdomain.” If you would rather have it based on subdirectories, select “subdirectory” instead. You can change this later if need be, although it’s usually easier to do so sooner than later.

Once finished on this screen, click Install.

4. Enable the network.

The next thing you’ll see are the activation instructions for your network. They should look something like this:

After you finish editing each file, save it and click the Log In link to continue.

After you finish this, you can start adding new subsites and configuring your multisite settings. To access network settings, go to My Sites and select any options from the dropdown menu.

Databases and WP Multisite Installations

WordPress installations come in three types, which are distinguished by system architecture or the combination of WordPress instances and databases:

Although there are multiple sites, the installation process for a WordPress site with multiple databases is no different than installing just one WordPress site.

Before you begin, create a MySQL database for each blog. If you don’t know how to do this, follow the instructions below.

The wp-config.php file will vary for each installation. The lines to change are the following:

The wp-config.php file is different for each installation. The lines that need to be changed are:

define(‘DB_NAME’, ‘wordpress’);    // The name of the database
define(‘DB_USER’, ‘username’);     // Your MySQL username
define(‘DB_PASSWORD’, ‘password’); // … and password

DB_NAME is the name of the individual database created for that blog. If you are using different user logins for each database, edit DB_USER and DB_PASSWORD to reflect this as well.

Upload each wp-config.php file to its specific root/installation directory, and run the installation. See Installing WordPress for more information.

You can use the WordPress multisite feature to create a network of websites by installing one instance and database.

If you’re looking to install multiple WordPress sites, the multisite feature may be a good option for you. However, there are some things you should take into account before using it. For more detailed information on this topic, see the following documents:

As described above, the wp-config.php file will differ for each installation when using a multiple-database solution. The only distinction between blogs in this case is a single line:

$table_prefix = ‘wp_’; // example: ‘wp_’ or ‘b2’ or ‘mylogin_’ 


WordPress assigns the table prefix wp_ to its MySQL database tables, but you can choose any prefix you want. By doing this, you create unique identifiers for each blog in your database. For example, if you have three blogs–named Main, Projects, and Test–substitute the prefix wp_ in each blog’s wp-config.php

Main blog:

$table_prefix = ‘main_’; 

 

Projects blog:

$table_prefix = ‘projects_’; 

 

Test blog:

$table_prefix = ‘test_’; 

 

You can use any prefix you want; the ones below are just examples.

Upload each wp-config.php file to its own root/installation directory, then start the installation process.

You can use the same user base for all your blogs on the same domain by defining the CUSTOM_USER_TABLE and optionally the CUSTOM_USER_META_TABLE constants to point to the same wp_your_blog_users and wp_your_blog_usermeta tables.

See Editing wp-config.php/Custom User and Usermeta Tables.

Multisite: A Hidden WordPress Superpower

Multisite is an unheralded feature of WordPress. Most users won’t need for it, but if you find yourself needing to manage multiple sites, Multisite will make your life much easier.

Bid farewell to perform the same mundane tasks for hours on end, and say hello to an intricate network of WordPress installations that are all related to each other. It’s something of a hidden superpower that can save you loads of time if used correctly!

Our thoughts on the pros, cons, and examples of WordPress Multisite. If you want your system built on WP Multisite, schedule a chat with us! You’ll be amazed at how simple it is to get started! Our support channels are always available to help you out!

Please let us know if you found this post useful in the comments section below.