WordPress Network is a feature offered by WordPress that enables users to create and manage multiple websites from one dashboard. For instance, if you have a company with independent products, you might want to develop various websites. Alternatively, you might want to create a development environment or website under a subdomain. In any case, creating and managing sites from different dashboards can be cumbersome and time-consuming. In this article, I will show you how can use WordPress netWork to develop and manage your website from one dashboard. Before we get started, let me give you some advantages and disadvantages of a WordPress Network.
Advantages of a WordPress networkThere are many advantages associated with this Wordpress feature. Some of them are:
- First of all, you can monitor your sites without having to switch from one dashboard to another.
- Secondly, all the websites on the network can use the plugins installed at the upper level. Hence, you can do one installation and use it for all the sites.
- Thirdly, it is much easier to update all your websites. Since you are using the same plugin and dashboard, updates at the upper level will apply to all other sites.
- Each website on the network has separate users and Dashboards. This feature can be useful if you have different people managing each site. Moreover, each section can have its administrators.
- You can easily manage the security aspects of your websites. One of the difficulties of managing multiples websites is to be able to handle security. For example; if you have more tasks to do on one side, you might seem to forget others.
Disadvantages of managing your website from a single dashboardBefore you start using this feature to manage your sites, there are some disadvantages that you need to know:
- For each website, WordPress duplicate database tables. Too many database tables can affect the performance of your website in case you start having too many sites.
- Because each website uses the same resources, the failure of a plugin will affect all the sites. For instance, a plugin at a point in time might stop working. In such a case, a website can stop working too.
- You can only use subdomains. You can define your network as sub.example.com or example.com/sub. In order words, you can't use the WordPress network to manage different websites with completely different domain names. In case you want to use different domains, you might have to do some customization or install a plugin.
- If you have excessive traffic on one website, other sites will be affected. All the websites are on the same server using the same resources.
How do you install a NetWork on your WordPress WebsiteTo install the network setting on your website, you need to, first of all, choose the configuration that you prefer. As briefly mentioned above, you can either select subdomain.example.com or example.com/subdomain. If we consider example.com to be your website. Note that you can have an indefinite number of the subdomain (for example - subdomain1, subdomain2 and so on).
Step 1 - Backup your website and disable your pluginsIn any web development process, we are never 100% sure of what could happen. So, to avoid any issues, you need to disable all your plugins and do a backup of your website. A backup of your site will include the database and all the files. You can find a full article about how to backup your website here - "WordPress Backups."If you intend to run WordPress out of the default directory, you can use your .htaccess file to do all the configuration before activating the multisite. The article from Wordpress.org is a complete guide that can help you to achieve that - "Giving WordPress Its Directory."
Step 2: Create wildcard subdomainsNote: If you are using subfolders, step 2 is not necessary.Wildcard Subdomains mean that any subdomain you create will be automatically activated. For example, if you define a wildcard for the domain example; you will have some this like this *.example.com. Any prefix that you add before example.com is active. i.e. app.example.com, or m.example.com. However, if you want to set up restrictions, you can use backend script like PHP or .htaccss to redirect. The steps to create wildcard subdomains may vary depending on your server. For a Cpanel under centos, this is how I will do it:
- Under the dashboard of my Cpanel, I will click on subdomains.
- And then, in the field subdomain, I will enter a star sign (*).
- I will select a domain (the one I wish to use as a wildcard domain).
- Finally, in the field document root, I will add the path to the folder where I want to point my subdomains. In our case, we are going to point it to the main Installation folder of WordPress. For example, if you install your WordPress in the public_html/WordPress, lead your wildcard to the public_html/WordPress.
- Do not forget to click on create
Step 3: Activate the Multisite feature.Once you have backup your data and disable plugins, you need to activate the multisite feature. To do that, open the file wp-config.php under your installation directory. Check the comment that says /* That's all, stop editing! Happy blogging. */. And paste the below line of code. If you were able to do that, refresh your browser and go to step 4.
Step 4: Install the feature on your WebsiteNow that you have activated the multisite network, you can follow these steps to do the installation:
- Login your WordPress Dashboard
- Click on tools after users tabs at the left side menu
- And then, you will see a new tab called Network setup. Click on that.
- You can now fill the form and install