Back to Community

Why Your WordPress Multisite Shows an Empty Directory After Changing a URL (And How to Fix It)

13 threads Sep 7, 2025 CoreNetworking wordpress

Content

Changing a site's URL within a WordPress Multisite network is a common task, but it can sometimes lead to a confusing result: the site loads a blank directory listing instead of the actual website. This guide will explain why this happens and walk you through the most reliable steps to fix it.

Why Does This Happen?

Based on common issues discussed in the community, this problem almost always occurs due to a server configuration mismatch. When you change a subsite's URL in the Network Admin, WordPress updates its internal database records. However, if the new domain (e.g., site1.com) is not properly configured on your web server to point to the main WordPress installation, the server doesn't know how to handle the request. Instead of passing it to WordPress for processing, it simply displays the contents of the folder—which is often empty, leading to a blank directory listing.

How to Fix the Empty Directory Issue

Follow these steps to resolve the problem. It's highly recommended to create a full backup of your site and database before proceeding.

Step 1: Verify Your Domain's DNS and Server Configuration

This is the most critical step. The new domain (e.g., site1.com) must have its DNS 'A' record pointing to your web server's IP address. Furthermore, your web server (e.g., Apache or Nginx) must be configured to recognize that domain and direct it to the root directory of your primary WordPress installation. This often involves setting up a parked domain, addon domain, or server alias that points to the same document root as your main network domain. If this is not done correctly, no amount of WordPress configuration will work.

Step 2: Revert the URL Change in WordPress

Since you cannot access the admin area for the broken site, you will need to manually revert its URL in the database.

  1. Access your database via a tool like phpMyAdmin.
  2. Locate the wp_blogs table (the prefix may be different).
  3. Find the row for your subsite and change the domain column back to its original, working value (e.g., from site1.com back to domain.com).
  4. Also, check the wp_site and wp_sitemeta tables to ensure the primary network domain is correct.

This should restore access to the subsite's admin area using its original URL.

Step 3: Perform a Complete Search and Replace

Once your server is correctly configured to handle the new domain, you can change the URL again. However, a simple change in the Network Admin may not update all references in the database. You must perform a thorough search-and-replace operation.

Recommended Method: Use a Reliable Plugin
The 'Better Search and Replace' plugin is frequently recommended in the community for this specific task. After reactivating the subsite's new URL in Network Admin, run the plugin from the subsite's own dashboard (Tools -> Better Search Replace). Search for the old URL (e.g., https://domain.com/site1) and replace it with the new one (e.g., https://site1.com). Ensure you select all database tables specific to that subsite.

Important Note on WP-CLI:
While powerful, using wp search-replace via WP-CLI for a single subsite in a network can be tricky. As noted in community discussions, the command must be run with the --url parameter targeting the specific subsite to ensure it only affects the correct tables. An imprecise command can miss data or accidentally break other sites in the network.

Step 4: Clear All Caches

After making these changes, clear any caching on your server, from any caching plugins (e.g., W3 Total Cache, WP Super Cache), and also your browser cache before testing the site again.

Conclusion

A WordPress Multisite loading an empty directory after a URL change is primarily a server configuration issue, not a bug in WordPress itself. The solution hinges on ensuring the new domain is correctly pointing to your WordPress installation before updating any settings within the database. By following the steps above—configuring your server, carefully reverting changes, and using a trusted search-and-replace method—you can successfully map your domain and avoid the dreaded empty folder.

Related Support Threads Support