Introduction
WordPress Multisite allows you to manage multiple websites from a single WordPress installation. This setup is useful when multiple sites need to share the same WordPress core, plugins, and themes while being managed through a centralized network dashboard. This document explains how to enable WordPress Multisite, configure the network settings, enable domain mapping, and add additional sites to the network.
Prerequisites
Before configuring WordPress Multisite, ensure the following requirements are met:
- A working WordPress installation with administrator access.
- Access to the WordPress
wp-config.phpand.htaccessfiles. - Access to the WordPress server with appropriate permissions.
- A valid domain or subdomain configured in DNS.
- A complete backup of the WordPress files and database.
- WordPress administrator access to enable Network Setup.
- The WPMU DEV Domain Mapping plugin downloaded and installed.
- Ensure the required PHP and Apache/Nginx configuration supports WordPress Multisite.
Implementation
In this post, we will explain how to setup multisite in WordPress.
Step 1: Open the wp-config file and copy and paste the following code just above the “That’s all, stop editing! Happy blogging” comment.
define('WP_ALLOW_MULTISITE', true);
Step 2: Open the wp-admin in the browser, go to Tools -> Network Setup, and click Install.
Step 3: After click install and you will get, complete the steps to enable the features for creating a network of sites.
Step 4: Add the following to your wp-config.php file in /var/www/html/ above the line reading /* That’s all, stop editing! Happy blogging. */:
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'domain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
Step 5: Add the following to your .htaccess file in /var/www/html/, replacing other WordPress rules:
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]
Step 5: Download the WPMU DEV Domain Mapping Plugin and install it.
Step 6: Open the wp-config file and find the copy-paste the following code just above the “That’s all, stop editing! Happy blogging” comment.
define('SUNRISE', 'on' );
Step 7: Copy the wp-content/plugins/domain-mapping/sunrise.php file to the wp-content folder. Use the following
cp /var/www/html/wp-content/plugins/domain-mapping/sunrise.php /var/www/html/wp-content/sunrise.php
Step 8: Go to Sites->Add new and add the subdomain.
Conclusion
WordPress Multisite has been successfully configured by enabling the network feature, updating the wp-config.php and .htaccess files, and configuring domain mapping. Additional sites can now be created and managed from the Network Admin → Sites section. Always maintain regular backups and verify DNS, SSL, and domain mapping settings when adding new sites to the network.
FAQs
1. What is WordPress Multisite?
WordPress Multisite allows multiple websites to be managed from a single WordPress installation and centralized dashboard.
2. Can I create multiple websites using one WordPress installation?
Yes. Once Multisite is enabled, you can create and manage multiple sites from Network Admin → Sites → Add New.
3. What is the purpose of WP_ALLOW_MULTISITE?
The WP_ALLOW_MULTISITE constant enables the WordPress Multisite/Network Setup feature.
Related Articles
How to Install reCAPTCHA in WordPress
How to reset the WordPress password in Mysql
Talk to our experts:
Looking for the right technology solution for your business?. Our experts can help with web hosting, domain registration, DevOps and cloud, software development, web applications, mobile applications, and enterprise solutions. Get in touch with our team here.