Fix WordPress My Sites Network Admin Broken Navigation Links

Steps taken with WordPress version 3.5.1:
On a development server, you installed WordPress running from a subfolder.
On the dev server, you then set up a WordPress Network and added a couple of subdomain sites.
You then installed WordPress on a production server, running from the same named subfolder as on dev.
You then backup the dev database, and import that into the production database.
Note: We may have flipped a previous network setup back to single site mode, and may have ‘moved’ WordPress from the web document root to a sub-folder.

Symptoms:
Navigation links for the “My Sites” -> “Network Admin” no longer work in production.
The same holds true for any “My Sites” -> “Sub Domain” that was added in development.
Also, if you can get to the Admin Dashboard, and then Plugins, clicking on an “update now” link also fails.
Curiously, links to “My Sites” and “My Sites” -> “My Main Site” remain functional.

Temporary Work Around:
When you are gracefully guided to the “That’s Embarrassing” page, you can type in the missing folder name in your browser’s URL location field and get to your “Network Admin.”

The Hack:
Note that this is sure to be overwritten during the next WordPress core upgrade.
Prepend that pesky subfolder name to the following path.

  1. File: wp-includes/link-template.php
  2. Function: network_admin_url()
  3. Line 2170 original: $url = network_site_url(‘wp-admin/network/’, $scheme);
  4. Replace with: $url = network_site_url(‘yoursubfolder/wp-admin/network/’, $scheme);

We have since reinstalled WordPress, and did not need this hack

Leave a comment

Your email address will not be published. Required fields are marked *

+ 69 = 78