How to Set Up a WordPress Multisite Network

Tomasz K. Dec 20, 2024 Multisite
How can I run multiple websites from one WordPress installation?
What are the steps to enable and configure a WordPress multisite network for managing multiple sites from a single installation?
Andy answered Dec 20, 2024

What is WordPress Multisite?

WordPress Multisite lets you manage multiple websites from a single WordPress installation. Each site shares the same core files but has its own content, themes, and plugins.

Prerequisites

  • Fresh WordPress installation or existing site
  • Access to wp-config.php file
  • Ability to modify server configuration files
  • Basic understanding of WordPress administration

Step-by-Step Setup Guide

1. Enable WP_ALLOW_MULTISITE

Add this line to wp-config.php before the "That's all, stop editing!" comment:

define( 'WP_ALLOW_MULTISITE', true );

2. Configure Network Settings

  1. Log in to WordPress admin
  2. Go to Tools → Network Setup
  3. Choose between subdirectories or subdomains
  4. Enter network details (title, admin email)

3. Update Configuration Files

After the network setup, WordPress will provide two code snippets:

Add this to wp-config.php:

define( 'MULTISITE', true );
define( 'SUBDOMAIN_INSTALL', false ); // true for subdomains
define( 'DOMAIN_CURRENT_SITE', 'example.com' );
define( 'PATH_CURRENT_SITE', '/' );
define( 'SITE_ID_CURRENT_SITE', 1 );
define( 'BLOG_ID_CURRENT_SITE', 1 );

Update .htaccess for Apache servers:

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]

Best Practices

  1. Choose URL structure wisely:

    • Subdomains: site1.example.com
    • Subdirectories: example.com/site1
  2. Plan your network structure before setup

  3. Regularly backup your network

  4. Use network-compatible themes and plugins

Security Considerations

  1. Limit super admin access
  2. Use strong passwords
  3. Implement SSL across all sites
  4. Regular updates for core, themes, and plugins
  5. Monitor network-wide user permissions

Common Pitfalls

  1. Not testing in a staging environment first
  2. Choosing wrong URL structure
  3. Installing incompatible plugins
  4. Insufficient server resources
  5. Not configuring proper backups

Useful Plugins

  1. Network Plugin Auditor

    • Tracks plugin usage across your network
  2. NS Cloner

    • Easily clone sites within your network
  3. User Switching

    • Switch between user accounts in multisite

Server Requirements

  1. Memory limit: 256M minimum
  2. PHP version: 7.4 or higher
  3. MySQL/MariaDB with InnoDB support
  4. Apache or Nginx with proper configurations

Troubleshooting Tips

  1. Check error logs
  2. Verify file permissions
  3. Test with default theme
  4. Disable all plugins temporarily
  5. Confirm server meets requirements

Remember to always backup your site before enabling multisite, as the process cannot be easily reversed without a fresh installation.