SYSTEMS OPERATIONAL
WordPress

WordPress Multisite Setup: Subdomains, Subdirectories & Fixes

Getwebup 5 min read

A client wants five sites for five branch offices, sharing one set of plugins and one login. Or you're running a small agency and don't want to manage twenty separate WordPress installs. That's the job Multisite was built for — but enable it in the wrong order and you'll be staring at a database error or a 404 on every subdomain within minutes of clicking "Install."

What Multisite Actually Solves

WordPress Multisite turns one installation into a network of sites that share the same wp-content folder, the same plugin and theme files, and the same users table. Each site gets its own set of database tables (posts, options, terms) but not its own copy of WordPress core or plugin code. That's the whole trade-off: less to update and patch, but every site on the network is tied to the same plugin versions and, usually, the same hosting resources.

It's the right tool for a network of related sites under one admin's control. It's the wrong tool if each site needs a different set of plugins, a different PHP version, or independent scaling — separate installs or separate accounts handle that better.

Subdomain vs Subdirectory: Decide Before You Touch wp-config.php

WordPress asks for this choice once, on the Network Setup screen, and it's painful to change afterward. Pick based on DNS control and how the URLs need to look.

TypeURL patternNeedsGood for
Subdomainsite1.example.comWildcard DNS record + wildcard subdomain in cPanelClient sites, branded network, cleaner SEO separation
Subdirectoryexample.com/site1No DNS changesMultilingual sites, docs sections, quick internal networks

One catch: if your main site has been live for more than a few weeks with content already indexed, WordPress will hide the subdirectory option unless you add define('WP_ALLOW_MULTISITE', true); to wp-config.php first and reload the Tools > Network screen — that's expected, not a bug.

Before You Enable Multisite: A Quick Checklist

  • Full cPanel backup (files + database) taken and downloaded off-server
  • Plugin list checked against the official multisite compatibility notes for each plugin — not everything plays nicely with a shared install
  • You have SSH or File Manager access to edit wp-config.php and .htaccess directly
  • You know your PHP memory_limit — multisite networks with several active sites need more headroom than a single install; 256M is a safer starting point than the default 128M

Step 1: Prepare wp-config.php

Deactivate all plugins first — multisite activation with active plugins is the single most common cause of a white screen right after. Then add this line just above the /* That's all, stop editing! */ comment:

define('WP_ALLOW_MULTISITE', true);

Save, reload wp-admin, and a new Network Setup item appears under Tools.

Step 2: Run the Network Setup Screen

Choose subdomain or subdirectory, confirm the network title and admin email, then click Install. WordPress generates two code blocks — one for wp-config.php, one for .htaccess. Copy both exactly as shown; don't paraphrase or reorder the lines.

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
$base = '/';
define('DOMAIN_CURRENT_SITE', 'example.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

Place this block right after the WP_ALLOW_MULTISITE line you added earlier, then log back in — the network install replaces the standard admin bar with a network dashboard.

Step 3: Point DNS for Subdomain Installs

Subdirectory networks need no DNS changes. Subdomain networks do, because every new site is a live subdomain that needs to resolve.

  1. In cPanel > Domains, add a wildcard subdomain: enter * as the subdomain for your main domain.
  2. In the DNS Zone Editor, confirm a wildcard A record exists: *.example.com pointing at your server IP (cPanel usually creates this automatically when you add the wildcard subdomain, but check it).
  3. If you're behind Cloudflare, add the same wildcard A record there and keep it proxied only if your plan supports wildcard SSL — unproxied is safer on lower-tier plans until you confirm the certificate covers it.

Common Errors After Network Activation

"Error establishing a database connection" only on new sites

This almost always means the per-site tables weren't created. Check phpMyAdmin for a set like wp_2_options, wp_2_posts. If they're missing, the site was created before the network tables finished writing — delete the broken site from Network Admin > Sites and recreate it rather than editing tables by hand.

New subdomain sites return a 404 or "server not found"

DNS, not WordPress. Run dig site1.example.com from a terminal and confirm it resolves to your server IP. If it doesn't, the wildcard A record hasn't propagated yet or wasn't saved — give it up to an hour and recheck before touching any WordPress settings.

White screen immediately after adding the network config block

Usually a leftover active plugin that isn't multisite-aware, or the config block placed in the wrong spot in wp-config.php. Rename the plugins folder over SFTP to confirm it's a plugin, then reintroduce plugins one at a time from Network Admin > Plugins, activating network-wide only after each one checks out.

Mixed content or "Not Secure" warning on new subdomains

Your SSL certificate needs to cover the wildcard. A single-domain AutoSSL certificate won't secure site1.example.com automatically — you need a wildcard certificate (Let's Encrypt wildcard via DNS validation, or a paid wildcard cert) issued for *.example.com.

Keeping the Network Healthy

  • Set per-site upload storage limits under Network Admin > Settings so one site can't fill the shared disk quota
  • Review network-activated plugins quarterly — a plugin update that breaks one site can break all of them at once
  • Back up the whole network, not per-site — a single database dump covers every site's tables together
  • Keep a staging network (or a single staging site) for testing plugin and core updates before pushing network-wide

Frequently asked questions

Can I convert a normal WordPress site into a Multisite network later?

Yes. Add WP_ALLOW_MULTISITE to wp-config.php on the existing install and run Network Setup - your current site becomes the main site of the new network. Back up first, since plugin conflicts are more likely on a site that already has content and active plugins.

Do all sites on a Multisite network share the same PHP version and resources?

Yes. Every site runs on the same PHP version, memory_limit, and hosting plan since they share one WordPress core install. If sites need different resource profiles, separate hosting accounts fit better than Multisite.

Why does subdirectory show as unavailable on Network Setup?

WordPress hides subdirectory mode if your site is more than a few weeks old with existing permalinks, to avoid breaking existing URLs. Adding WP_ALLOW_MULTISITE and reloading the screen usually brings the option back, or you can force it before content builds up.

Can each site in the network use different plugins?

Plugins install once for the whole network, but you choose per-site whether to activate them from each site's own Plugins screen - unless a plugin is Network Activated, which forces it on for every site.

Is a wildcard SSL certificate required for a subdomain-based network?

Yes, if you want every subdomain site to load over HTTPS without a certificate warning. A single-domain certificate only covers the main domain, not *.example.com subdomains - you need a wildcard certificate covering the whole domain.

#wordpress-multisite #multisite-network #subdomain-install #wildcard-dns #wp-config #cpanel

Keep reading

Chat with Support