WordPress multisite functionality allows you to manage several websites from a single installation. Whether you’re a developer, site administrator, or simply want to simplify your online presence, this step-by-step tutorial will lead you through the process of setting up and efficiently administering several sites using Multisite WordPress
Backup Website
Make a full backup of the existing WordPress installation before starting. This is necessary to avoid data loss during the setup procedure. Configure WordPress Installation.
Setting up Multisite
Use a code editor to access wp-config.php by opening the corresponding file in the WordPress installation.
Constants for Multiple Sites: Add the following lines after defining ('WP_DEBUG', false);
define('WP_ALLOW_MULTISITE', true);
Save your modifications and re-upload the wp-config.php file to your server.
Multisite Setup
When logging in to the WordPress dashboard, select “Tools” > “Network Setup”.
Select the suitable site structure from subdomains or subdirectories. Click “install” after entering the network title and admin email.
Network Configuration
WP-config.php and .htaccess files need to be updated. Make the appropriate adjustments as directed. Add the following code snippet above the line in the wp-config.php file.
define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false );
define( 'DOMAIN_CURRENT_SITE', 'domain.name' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );
Change the domain.name to the real domain name. Insert the following code into the .htaccess file:
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
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]
Save the modifications to the wp-config.php and.htaccess files.
Log In Again
Log out of the WordPress admin dashboard.
Please log in again. The Multisite Network Admin dashboard is now available. It is accessible via the “My Sites” option located in the admin bar’s upper left corner.
Add Subsites
To add more subsites, navigate to “Sites” and click “Add New” from the Network Admin dashboard. Fill out the required information for each subsite.
Subsite Configuration
From the Network Admin dashboard, set up options for each subsite, like as themes, plugins, and user permissions.
Thus by following these procedures and following best practices, you may administer a network of websites efficiently, saving time and money while keeping a consistent online appearance. WordPress Multisite with subdirectories is an excellent resource for web developers, site managers, and corporations looking for a centralized solution for administering several websites.