Have you ever wanted to manage multiple WordPress websites from a single installation? I’ve been there, and I’m going to show you exactly how to set up WordPress multisite with root domains. This powerful setup lets you run as many separate websites as you need—all from one WordPress core installation and one database. Trust me, it’s a game-changer for multi-site management.
WordPress multisite is a remarkable feature that transforms a standard WordPress installation into a network of sites. While WordPress officially supports subdomain and subfolder multisite configurations, this guide focuses on using completely separate root domains—something many don’t realize is possible!
For example, you can have example1.com, example2.org, and example3.net all running from the same WordPress installation. Each site looks and functions independently, but behind the scenes, you’re saving tremendous time and resources.
I’ve managed dozens of WordPress sites over the years, and multisite has completely transformed my workflow. Here’s why you’ll love this approach:
Managing multiple WordPress sites separately is a nightmare. With multisite, you’ll:
This saves hours of repetitive maintenance every week!
Many hosting providers charge per installation or have limitations on lower-tier plans. Multisite lets you:
Database limitations can be frustrating. Multisite solves this by:
When your sites live under one roof, you can:
Let’s get your multisite network running with separate root domains. I’ll walk you through each step of this process.
Start with a standard WordPress installation for your first site. There’s nothing special required at this stage, but I strongly recommend using a custom database prefix instead of the default “wp_” for better organization and security.
For example, if your first site is “techblog.com”, use something like “tech_” as your database prefix.
// Example database configuration with custom prefix
define('DB_NAME', 'your_database');
define('DB_USER', 'your_username');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
$table_prefix = 'tech_';
Code language: PHP (php)
Before proceeding, make sure all your domains point to the same hosting directory. This typically involves:
Now comes the clever part. Follow these steps carefully for each additional site:
First, create a backup of your wp-config.php file. This is absolutely critical—skip this, and you risk breaking your existing site.
# SSH command example to back up your config
cp wp-config.php wp-config.php.backup
Code language: CSS (css)
Next, remove the wp-config.php file from your server. This tricks WordPress into thinking this is a fresh installation when you visit your second domain.
Important Warning: Your first site will be temporarily unavailable during this step! Schedule this during low-traffic hours.
Now, access your second domain in your browser. WordPress will present you with the installation screen since it can’t find a configuration file.
Complete the installation process as you normally would, but pay special attention to the database prefix. Use a unique prefix that reflects this domain—if your second site is “petstore.com”, you might use “pets_” as the prefix.
Once you’ve completed the installation for your second site, it’s time to modify the wp-config.php file to dynamically change the database prefix based on the domain being accessed.
Replace your wp-config.php with this improved version:
// Standard WordPress database configuration
define('DB_NAME', 'your_database');
define('DB_USER', 'your_username');
define('DB_PASSWORD', 'your_password');
define('DB_HOST', 'localhost');
// Dynamic table prefix based on domain
if($_SERVER['HTTP_HOST'] == 'techblog.com' || $_SERVER['HTTP_HOST'] == 'www.techblog.com') {
$table_prefix = 'tech_';
}
else if($_SERVER['HTTP_HOST'] == 'petstore.com' || $_SERVER['HTTP_HOST'] == 'www.petstore.com') {
$table_prefix = 'pets_';
}
// Add additional domains as needed
else if($_SERVER['HTTP_HOST'] == 'yourthirddomain.net' || $_SERVER['HTTP_HOST'] == 'www.yourthirddomain.net') {
$table_prefix = 'third_';
}
// Default prefix as fallback
else {
$table_prefix = 'wp_';
}
Code language: PHP (php)
For a more robust setup, I recommend these additional configurations:
Most configuration constants can be shared across all sites. Keep these in the main section of wp-config.php:
// Security keys (get unique keys from https://api.wordpress.org/secret-key/1.1/salt/)
define('AUTH_KEY', 'your-unique-key');
define('SECURE_AUTH_KEY', 'your-unique-key');
define('LOGGED_IN_KEY', 'your-unique-key');
define('NONCE_KEY', 'your-unique-key');
define('AUTH_SALT', 'your-unique-key');
define('SECURE_AUTH_SALT', 'your-unique-key');
define('LOGGED_IN_SALT', 'your-unique-key');
define('NONCE_SALT', 'your-unique-key');
// Debug settings (turn off for production)
define('WP_DEBUG', false);
Code language: JavaScript (javascript)
You can also add domain-specific configuration settings:
// Domain-specific settings
if($_SERVER['HTTP_HOST'] == 'techblog.com' || $_SERVER['HTTP_HOST'] == 'www.techblog.com') {
define('WP_DEBUG', true); // Enable debugging only on this site
}
Code language: PHP (php)
Even with careful setup, you might encounter some challenges. Here’s how to solve the most common issues:
If you get a blank white screen after installation:
If you’re having trouble staying logged in:
Not all plugins play nicely with multisite. If you encounter issues:
Want to take your multisite setup to the next level? Try these advanced techniques:
Consider using ManageWP, MainWP, or InfiniteWP to manage all your sites from a single dashboard. These tools complement your multisite setup perfectly.
For a more elegant setup, explore domain mapping plugins that work with root domains. This creates a more structured relationship between your sites.
As your multisite network grows, database performance becomes crucial. Consider:
WordPress multisite with root domains gives you the best of both worlds—the efficiency of unified management with the flexibility of separate websites. I’ve been using this setup for years to manage multiple client sites, and it’s saved countless hours of maintenance time.
While the official WordPress documentation doesn’t focus much on this approach, it’s completely viable and offers tremendous advantages for developers and site managers who need to handle multiple independent websites.
Have you tried setting up WordPress multisite with root domains? What challenges did you face? Share your experience in the comments below!
You've conquered the service worker lifecycle, mastered caching strategies, and explored advanced features. Now it's time to lock down your implementation with battle-tested service worker…
Unlock the full potential of service workers with advanced features like push notifications, background sync, and performance optimization techniques that transform your web app into…
Learn how to integrate service workers in React, Next.js, Vue, and Angular with practical code examples and production-ready implementations for modern web applications.
This website uses cookies.