Tag - Network

How to Install and Setup WordPress Multisite Network


Do you want to set up and install WordPress multisite network? WordPress comes with a built-in capability to create multiple websites using the same WordPress installation.

A WordPress multisite network is used by blogs, schools, and businesses, who need to run separate websites but want to manage them under one dashboard.

In this article, we will show you how to properly install and setup a WordPress multisite network.

How to install and setup WordPress multisite network

Since this is a comprehensive article, we have added the table of contents for easier navigation:

WordPress Multisite Basics

  1. What is WordPress Multisite?
  2. Pros of using a WordPress multisite network
  3. Cons of using a WordPress multisite network
  4. Who needs a WordPress multisite network?

WordPress Multisite Installation and Set up

  1. Requirements for a WordPress multisite network
  2. Choosing a domain structure for your multisite network
  3. Setting up wildcard subdomains
  4. Enabling WordPress multisite network feature
  5. Setting up your WordPress multisite network

WordPress Multisite Configuration Settings

  1. Configuring network settings
  2. Opening your multisite network for registrations
  3. New site settings
  4. Upload settings for your multisite network
  5. Plugin menu settings

Setting up Default Content, Theme, and Plugins

  1. Adding new sites to your WordPress multisite network
  2. Adding themes and plugins to your multisite network
  3. Adding default Content to new sites
  4. Troubleshooting and FAQs

    1. Troubleshooting WordPress multisite issues
    2. FAQs about WordPress multisite

    What is WordPress Multisite Network?

    A WordPress Multisite network allows you to run and manage multiple WordPress sites or blogs from a single WordPress installation.

    It enables you to create new sites instantly and manage them using the same username and password. You can even allow other users to signup and create their own blogs on your domain.

    The WordPress multisite network comes with advanced settings that you can use to customize each website / blog on your network.

    Pros of Using a WordPress Multisite Network

    In many situations, a WordPress multisite network can be more useful than managing multiple standalone WordPress sites. Here are some of the advantages of using a WordPress multisite network:

    1. As the network administrator, you can easily manage multiple sites from a single dashboard.
    2. Each site on the network can have its own admins. The site admins will have the capabilities to manage only their own website.
    3. You can install plugins / themes and activate them for multiple sites with one download.
    4. Multisite network also makes it easier for you to manage updates. You only need to update your WordPress, plugins, or themes on one “master” install.

    Cons of Using a WordPress Multisite Network

    Creating a WordPress multisite network is not always helpful in managing multiple sites. Here are some of the disadvantages that you should keep in mind before setting up a multisite network.

    1. All sites on the network share the same resources. This means that when your network is down, all other sites go down as well.
    2. It’s not easy to manage traffic and server resources for the beginner level users. In case, one of your websites gets unexpected traffic, then it will affect all other websites on the network.
    3. If one website gets hacked, then this means all sites on your network will get hacked.
    4. Some WordPress plugins may not work well on a multisite network.
    5. WordPress multisite network is not properly supported by all web hosting providers which limits your options. We will talk more about this later in the article.

    Who needs a WordPress multisite network?

    Just because you manage multiple WordPress websites does not mean you need to start using a multisite network.

    There are third party tools to manage multiple WordPress sites from a single dashboard. Tools like InfiniteWP or iThemes Sync make it easier to maintain multiple WordPress sites under one roof without switching back and forth from one site to another.

    Here are some scenarios when creating a multisite network makes sense:

    1. A magazine website with different sections managed by different teams.
    2. A business website with sub-sites for different locations and branches.
    3. Government or non-profit websites can use WordPress multisite for different departments, locations, and regions.
    4. Your own network of blogs running on multiple subdomains.
    5. Schools and colleges allowing students to create their own blogs on school servers.

    Requirements for a WordPress Multisite Network

    All websites on a WordPress multisite network share the same server resources. This means that the most important thing you will need is a good WordPress hosting.

    If you are planning on having just a couple of websites with low traffic, then you can probably get away with shared hosting.

    However, due to the nature of multisite network, you’d need VPS hosting or a dedicated server as your sites grow.

    We recommend Bluehost because they offer both shared hosting and VPS/Dedicated servers, and they are also one of the official WordPress hosting partners.

    If you’re looking for an alternative, then SiteGround and WP Engine provide excellent service for WordPress multisite network.

    Apart from web hosting, you will need the basic knowledge of how to install WordPress and editing files using FTP.

    Choosing a Domain Structure for your Multisite Network

    On a WordPress multisite network, you can add new sites using either subdomains or sub-directories.

    Example of subdomain:
    http://site1.example.com

    Example of sub-directory:
    http://example.com/site1/

    If you choose subdomains, then you will have to configure wildcard subdomains on your server. We will show you how to do that in the next step.

    On the other hand, if you choose sub-directories or path based URLs for sites on your network, then you can skip the next step.

    Setting Up Wildcard Subdomains

    If you decide to use subdomains for websites on your multisite network, then you will need to setup wildcard subdomains for your multisite network.

    To do that, first you need to login to your WordPress hosting account’s cPanel dashboard. After that, you need to scroll down to the ‘Domains’ section and then click on ‘Subdomains’.

    Setting up wild card subdomains

    Note: Depending on your web hosting service, your cPanel dashboard may look slightly different than the screenshot above. This screenshot is from the cPanel on Bluehost.

    On the next page, you need to enter the * sign in the subdomain field and select your main domain from the drop-down menu.

    Adding wildcard subdomain

    Cpanel will automatically detect the document root and will display it in the field below. Now click on the ‘Create’ button to add your wildcard subdomain.

    Enabling WordPress Multisite Network Feature

    Multisite Network feature comes built-in with each WordPress installation. All you need to do is install and setup WordPress like you normally would. After that, you just need to enable the multisite feature.

    You can also enable the multisite feature on any existing WordPress site. Before you enable multisite, don’t forget to create a complete backup of your WordPress site.

    To enable Multisite, connect to your site using a FTP client or cPanel file manager, and open the wp-config.php file for editing.

    You need to add the following code to your wp-config.php file just before the /* That’s all, stop editing! Happy blogging. */ line.

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

    Once you are done, you can save and upload your wp-config.php file back to the server.

    This code simply enables the multisite feature on your WordPress site. Once enabled, you will still need to setup the multisite network.

    Setting Up Your WordPress Multisite Network

    Now that you have successfully enabled the Multisite Network feature on your WordPress site, it is time to set up your network.

    If you are setting up a mutlisite network on an existing WordPress website, then you will need to deactivate all plugins on your site.

    Simply visit the Plugins » Installed Plugins page and select all plugins. You need to select ‘Deactivate’ from the ‘Bulk Actions’ dropdown menu and then click on the ‘Apply’ button.

    Deactivate plugins

    You can now head over to Tools » Network Setup page to configure your multisite network.

    WordPress multisite network setup

    On the network setup screen, you will see a notice that you need Apache’s mod_rewrite module installed on your server. This module is installed and enabled on all the best WordPress hosting providers.

    The next thing you need to do is to tell WordPress what kind of domain structure you will be using for sites in your network, e.g. Subdomains or Sub-directories.

    After that, you would need to provide a title for your network and make sure that the email address in the Network admin email is correct.

    Click on the install button to continue.

    WordPress will now show you some code that you need to add to your wp-config.php and .htaccess file respectively.

    Add code to wp-config and .htaccess files

    You can use an FTP client or file manager in the cPanel to copy and paste the code in these two files.

    After that you will need to re-login to your WordPress site to access the multisite network.

    Configuring Network Settings

    Now that you have setup the multisite network, it is time to configure network settings.

    You need to switch to the ‘Network Dashboard’ to change network settings, add new sites, and configure other settings.

    When you take your mouse over to the ‘My Sites’ menu in the admin toolbar, a flydown popup will appear. Click on the Network Admin » Dashboard.

    Network admin dashboard

    This will take you to the multisite network dashboard. You will notice that there are new menu items to manage your multisite network. You will also see a “Right Now” dashboard widget that allows you to create a new site and add new users.

    Network dashboard

    To configure network settings, you need to click on the ‘Settings’ link in the admin sidebar.

    The first option on network settings page is to set your site title and admin email address. These fields will be filled automatically with the network title and admin email you entered during setup.

    Network settings

    Opening Your Multisite Network for Registrations

    The ‘Registration Settings’ section on the network settings page is probably the most important setting in your network setup.

    By default, both user and site registrations are disabled on the network.

    You can choose to open your site for user registration, or allow existing users to create new sites, or allow both user and site registration.

    WordPress multisite registration settings

    If you are opening your multisite network to registration, then you can check the box next to ‘Registration Notification’ option to receive email notifications every time a new user or site is registered.

    If you want to allow individual site administrators to add new users on their sites, then you can check the box next to ‘Add New Users’ option.

    Registration options

    Limited Email Registration option allows you to limit site or user registration to email addresses from specific domains. This is particularly useful if you only want to allow people from your own organization to register and create users or sites.

    Similarly, you can also ban certain domains from registration.

    New Site Settings

    The ‘New Site Settings’ section allows you to configure default options for new sites created on your multisite network.

    You can modify the welcome emails and the contents of first default post, page, and comment in these settings.

    New site settings

    As a network administrator, you can change these settings anytime.

    Upload Settings for Your Multisite Network

    It is important for you to keep an eye on the usage of your server resources. Under the Upload Settings section, you can limit the total amount of space a site can use for uploads.

    The default value is 100 MB which is probably good for at least 100 photo uploads. You can increase or decrease this space depending on how much disk space you have.

    Upload settings

    The default upload file types are images, audio, video, and pdf files. You can add additional file types if you want like doc, docx, odt, etc.

    After that, you can choose a file size limit, so that users can’t upload insanely large files to the server.

    Plugin Menu Settings

    Next, you can jump to the menu settings. It will allow you to enable the administrative menu for the plugins section on your network sites.

    Show or hide plugins menu to site admins

    Enabling this will show plugins menu to respective site admins. They can activate or deactivate a plugin on their individual sites, but they cannot install new plugins.

    Once you are satisfied with all the configuration settings, make sure to click on the ‘Save Changes’ button.

    Adding New Sites to Your WordPress Multisite Network

    To add a new site to your WordPress multisite network, simply click on ‘Sites’ under My Sites » Network Admin menu in the admin toolbar.

    Adding new sites to your WordPress multisite network

    This will show you a list of sites on your current multisite installation. By default, you have your primary site listed as the only site in your WordPress multisite network.

    To add a new site, click on the ‘Add New’ button at the top.

    Add new site

    On the ‘Add New Site’ page, you need to provide the site’s address. You don’t need to type the full address, just the part you want to use as subdomain or sub-directory.

    Next, you need to add a site title, and enter the site admin’s email address.

    Adding new site details

    You can add an admin email address other than the one that you are currently using to manage your multisite network.

    If the email address is not currently in use by another user, then WordPress will create a new user and send the username and password to the email address you enter.

    Once you are done, click on the ‘Add Site’ button.

    A new site will be added to your WordPress multisite network. As the network admin, you will receive a new site registration email as well.

    If you created a new user, then that user will receive an email with instructions to set a new password and login.

    Adding Themes and Plugins to Your Multisite Network

    By default, individual site administrators in a multisite network cannot install themes and plugins on their own.

    As the network admin, you can install the respective plugins and themes, so it’s available for all sites on your network.

    Installing themes for your multisite network

    To add themes, go to My Sites » Network Admin » Themes page.

    Installed themes on your WordPress multisite network

    On this page, you will see a list of currently installed themes on your WordPress multisite.

    You can make a theme available to other sites by clicking on ‘Network Enable’ option under that theme. You can also disable a theme by clicking on ‘Network Disable’ link under the theme. Note: Network Disable option will only appear when the theme is enabled.

    To add a new theme, you need to click on the ‘Add New’ button at the top of your screen and then install a WordPress theme as you would normally do.

    Once the new theme is installed, you will be able to make it available to other sites on your network with the ‘Network Enable’ option.

    If you need recommendations on which themes to make available to your network, take a look at our picks of the best WordPress themes that you can use.

Setting a default theme for your Multisite Network

After you have added a couple of themes, WordPress will still activate the default WordPress theme for each new site.

If you want to make another theme to be the default theme for new sites, then you need to add the following code to your wp-config.php file.


// Setting default theme for new sites
define( 'WP_DEFAULT_THEME', 'your-theme' );

Replace your-theme with the name of your theme. You will need to use the name of the theme’s folder, which you can find out by looking at the /wp-content/themes/ folder.

Installing plugins for your multisite network

Similarly, you can visit My Sites » Network Admin » Plugins page to install plugins and click on the ‘Network Activate’ link below each plugin to activate them on your multisite network.

Network activate plugins on a WordPress multisite

Following are a few essential WordPress plugins that we recommend for every website:

For more plugin recommendations, see our list of the essential WordPress plugins for all websites.

Note: If you have enabled the Plugins Menu option for site admins in the ‘Network Settings’ previously, then the site administrators can activate or deactivate installed plugins on their own. Site admins cannot delete or install a new plugin on their own.

Adding Default Content to Multisite Sites

By default, WordPress allows you to edit some default content for each site on your multisite network. You can go to Settings » Network Settings page and add them under the section ‘New site settings’.

New site defaults

You can edit the content for the default post, page, and comment. We recommend replacing the default content with something more useful for your site admins.

What if you wanted additional default content to be added to each new site?

By default, WordPress does not give you an option to create additional default content for new sites. If you want to do that, then you will need to add custom code to your WordPress multisite.

In this example, we are going to add a new default page to be created for each new site.


add_action('wpmu_new_blog', 'wpb_create_my_pages', 10, 2);
 
function wpb_create_my_pages($blog_id, $user_id)
  switch_to_blog($blog_id);
 
// create a new page
  $page_id = wp_insert_post(array(
    'post_title'     => 'About',
    'post_name'      => 'about',
    'post_content'   => 'This is an about page. You can use it to introduce yourself to your readers or you can simply delete it.',
    'post_status'    => 'publish',
    'post_author'    => $user_id, // or "1" (super-admin?)
    'post_type'      => 'page',
    'menu_order'     => 1,
    'comment_status' => 'closed',
    'ping_status'    => 'closed',
 ));
  
restore_current_blog();


You can use the same code with little modifications to create default posts for new sites. Check out the following code:


add_action('wpmu_new_blog', 'wpb_create_my_pages', 10, 2);
 
function wpb_create_my_pages($blog_id, $user_id)
  switch_to_blog($blog_id);
 
// create a new page
  $page_id = wp_insert_post(array(
    'post_title'     => 'A sample blog post',
    'post_name'      => 'sample-blog-post',
    'post_content'   => 'This is just another sample blog post. Feel free to delete it.',
    'post_status'    => 'publish',
    'post_author'    => $user_id, // or "1" (super-admin?)
    'post_type'      => 'post',
 ));
  
restore_current_blog();


Troubleshooting WordPress Multisite Issues

Most common issues with WordPress multisite network setup occur due to incorrect configuration of wildcard subdomains and domain mapping issues. Make sure that your web host supports wildcard subdomains before setting up multisite.

Following are some other common issues and their quick fixes.

Fixing login issues on multisite installs

Another common issue is that when using WordPress multisite with sub-directories, some users are unable to login to the admin area of their sites after they add the required code in wp-config.php file.

To fix this, try replacing


define('SUBDOMAIN_INSTALL', false);

line in wp-config.php file with


define('SUBDOMAIN_INSTALL', 'false');

Find unconfirmed users

Another issue that you may come across is not being able to find users who registered on your network but didn’t get the activation email. To fix this issue, see our guide on how to find pending unconfirmed users in WordPress.

Exporting a site from multisite to its own WordPress install

Later at some point, you or another site owner may want to export a site from multisite to its own WordPress install. This can be easily done. For step by step instructions see our guide on how to move a site from WordPress multisite to single install.

You may also want to bookmark our ultimate guide of common WordPress errors and how to fix them. It will save you a lot of time by quickly fixing the most common WordPress issues.

FAQs About WordPress Multisite Network

Many of our users have asked us plenty of questions about WordPress multisite network and how to use it more efficiently. Following are the most frequently asked questions that we have answered.

1. Would I be able to better manage my sites with a multisite network?

To be honest, the answer really depends on your usage scenario.

For example, if your websites are not related to each other, then you would be better off with a multiple site management tool, like InifiteWP.

If you manage multiple sites for a restaurant chain, university, or online magazine, then WordPress multisite will be more efficient.

2. Does WordPress multisite make my websites load faster?

Once again it depends on several factors. Better WordPress hosting with plenty of server resources will allow multisite to be faster but then again with these resources, individual WordPress sites will also run faster.

However, on a shared hosting account, traffic spikes will increase memory usage and slow down all websites on the multisite network at the same time. To improve multisite speed, see our guide on WordPress performance and speed optimization.

3. Can I add an online store to a WordPress Multisite Website?

Yes, you can add an online store in WordPress multisite network. Most likely, you will be using an eCommerce plugin like WooCommerce for that, which is compatible with WordPress multisite.

4. Can I install ‘x plugin’ on my WordPress multisite?

Some WordPress plugins may not be compatible with WordPress multisite. Normally, plugin authors mention it on the plugin’s website and you can avoid installing a plugin that may not work on a multisite setup. However, if it is not mentioned, then it is safe to assume that it is multisite compatible.

4. How do I share user logins and roles across the multisite network?

By default, a user who is registered on one site cannot register or be added to another site on the same network. That’s because they are already registered in the shared WordPress database. However, they don’t have any user role privileges on other sites.

You can use third-party plugins like WP Multisite User Sync to sync users across the network. However, you need to be careful as you may end up giving someone admin privileges to a site.

We hope this article helped you learn how to install and setup WordPress multisite network. You may also want to see our step by step WordPress security guide to protect and keep your WordPress multisite secure.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.



Source link