The wp-config.php file is where a WordPress Multisite network begins to reveal its true capacity. While the default installer provides sensible baselines, a network of even a modest size often outgrows those defaults. Administrators managing multiple sites under a single installation have unique considerations: database contention, file system contention, and the need for consistent performance across all subsites. Tweaking this file isn’t about making drastic changes; it’s about aligning the platform’s behavior with the specific demands of your network.
One of the most frequently adjusted constants is WP_MEMORY_LIMIT. By default, WordPress sets this to 40 megabytes, which is sufficient for a single site but can trigger fatal errors when plugins and themes run simultaneously across a network. Increasing this to 64 or 96 megabytes can prevent crashes, but on shared hosting, a higher limit may consume resources that other sites depend on. The related WP_MAX_MEMORY_LIMIT controls the ceiling for administrative actions and post editors, and raising it to 256 megabytes is common for sites that rely on heavy page builders or complex SEO plugins. The trade-off is straightforward: more memory improves stability, but on resource-constrained servers it can lead to slower response times for all sites in the network.
WP_CACHE is another constant that yields noticeable differences depending on traffic patterns. Enabling it requires a persistent caching layer such as Redis or Memcached. For a network experiencing frequent post revisions or high concurrent logins, WP_CACHE can slash DB query counts by half or more. However, setting it up adds operational complexity: you need a running cache daemon, proper permissions, and monitoring to ensure cache invalidation stays in sync. On a low-traffic network, the performance gain may not justify the added moving parts.
DISALLOW_FILE_EDIT is a simple but effective constant. Setting it to true prevents the Theme and Plugin editors from appearing under Appearance or Plugins in the admin bar. This is particularly useful for Multisite networks where you want to enforce that code changes go through a development workflow rather than direct admin edits. The downside is minor: editors who are accustomed to making on-the-fly changes will find the interface grayed out, which can lead to support tickets if not documented. Pairing this with DISALLOW_UNINSTALL_PLUGIN adds another layer of protection, though it can make troubleshooting more involved if a plugin needs to be removed quickly.
The SUBDOMAIN_INSTALL constant determines whether your network uses subdomains (site1.example.com) or subdirectories (example.com/site1). This choice isn’t purely aesthetic; it affects how cookies are handled, how .htaccess rules are generated, and even how some plugins path their assets. Migrating from one structure to the other after a network is live is possible but requires careful URL mapping and, often, a fresh start for affected sites. For new networks, deciding early saves significant rework later.
A frequent misstep involves modifying constants without a corresponding backup or staging test. Because wp-config.php is loaded on every page request, a syntax error—a missing quote, an extra comma, a misplaced constant—takes the entire network offline immediately. The white screen of death is the classic result. Another mistake is setting WP_DEBUG to true on a production Multisite network solely to diagnose a plugin conflict. While developer-friendly, this constant can leak sensitive file paths or database details to visitors if error reporting isn’t tightly scoped. Using WP_DEBUG_LOG instead, which writes errors to a file rather than displaying them, is a safer compromise.
These tweaks, when applied thoughtfully, align the technical underpinnings of your network with its operational reality. The goal isn’t to apply every possible constant, but to select those that address your specific performance bottlenecks, security requirements, and management workflows. Regularly reviewing your network’s query monitor, error logs, and resource usage will indicate which adjustments yield real-world benefits and which merely add overhead.
Frequently Asked Questions (FAQs)
What is the safest way to increase memory limits on a Multisite network?
Begin by testing the change on a single site or staging environment. If no errors appear, update WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT in wp-config.php, then monitor site performance and server resource usage through your hosting control panel or a plugin like Query Monitor.
Can enabling WP_CACHE break any part of a Multisite network?
Yes, if a persistent cache is not properly invalidated, users may see stale content such as outdated post revisions or outdated plugin settings. It is essential to use a reliable caching daemon and test changes on a development site before enabling them across the network.
Is it necessary to change SUBDOMAIN_INSTALL after a network has been established?
Changing SUBDOMAIN_INSTALL after launch is possible but complex. It typically involves adjusting site URLs, updating .htaccess rules, and sometimes recreating affected sites. Planning the structure from the start is far less disruptive than migrating later.
What does DISALLOW_FILE_EDIT actually prevent, and are there downsides?
It removes the Theme and Plugin code editors from the WordPress admin, preventing direct file modifications. A potential downside is that legitimate users who rely on those editors for quick changes will need an alternative workflow, such as FTP or a child theme setup, which may require additional training or documentation.
How can I diagnose if a wp-config.php constant is causing network issues?
Enable WP_DEBUG_LOG to write errors to a file, then review the log for PHP warnings or fatal errors related to the constant in question. Server error logs and plugin-specific debug modes can also provide clues about which adjustment is triggering the problem.
Should I set DISALLOW_UNINSTALL_PLUGIN on a Multisite network?
This constant prevents any plugin from being uninstalled via the admin interface, which can be useful for maintaining network stability and preventing accidental removals. However, it may hinder troubleshooting if a plugin needs to be disabled quickly, so weigh the need for control against the potential need for rapid intervention.
Is there a risk in using WP_CACHE on a low-traffic Multisite network?
On a network with few visitors and minimal plugin activity, the performance benefit of WP_CACHE is often negligible. The added complexity of managing a cache daemon and ensuring proper invalidation may outweigh any minor speed gains, making the default configuration a more practical choice.