anon
anon

Reputation:

Wordpress Multisite - Cannot switch Dashboards (Same Domain)

I have created a multisite website. I'm having issues where if I go to Network Admin all the multisite domains have the same url. (If I use the main domain login)

(Look at bottom-left of gif) enter image description here

If I log into one of the sub sites then the domains are all correct.

(Look at bottom-left of gif) enter image description here

Where are the domains for the sites pulled from?

Everything about the multisite setup is absolutely fine apart from the URLs when I log into the main site it won't let me switch dashboards.

Here is some of my debugging. For some reason it fails to return the correct home URL even though the IDs of the blog are correct and the domain is correct in the database. enter image description here

Once again here the domains are all correct if I don't log into the primary domain...

enter image description here

Is this a Wordpress bug? I recently went on to another of our multisite setups to compare the settings and the problem exists on a completely separate multisite. Unless this is something we have set up incorrectly I cannot work out the cause of it.

Upvotes: 0

Views: 995

Answers (1)

Emerson Maningo
Emerson Maningo

Reputation: 2279

This is not happening with default WordPress multisite installation. So its probably caused by plugins, or some custom code inside the main site theme.

Since you don't provide details regarding your plugin and theme setup. What I would do are as follows:

->In your test site (not production site), go to your Network admin -> plugins. Deactivate each network activated plugins one by one.

Say you have 3 network activated plugins A, B , C. I would

  • Deactivate plugin A first, then check if deactivating resolves the issue.
  • If not, activate plugin A again , but deactivate plugin B now.
  • If not still, activate plugin B , and deactivate plugin C.
  • If not, activate plugin C, etc..

This type of troubleshooting is helpful to identify the source of the issue. Once you found it, I would suggest to report to the plugin author for fixing this.

->If after deactivating the network activated plugins one by one in the network won't resolve the issue. Go now to the main site activated plugins: sc-group.ab-uk.com/wp-admin/plugins.php

Then there deactivate each plugins one by one and see if deactivating any of those plugins resolves the issue. (just like what is done on the network activated plugins).

If you found the plugin that is causing the issue, report to the plugin author for fixing.

->Lastly if deactivating plugins (both network and main site) won't help. Switch the main site theme to default WordPress theme like Twenty Seventeen to see if it fixes the issue. If it fixes the issue, it means there is some custom code in the previously activated theme that is causing this one.

Again I would do this troubleshooting in a test site (not in production).

The function in WordPress that displays those are found in wp-includes/admin-bar.php. The function name is wp_admin_bar_my_sites_menu()

WordPress does this by looping through the user blogs then using switch_to_blog(). And get the admin URL using admin_url() function. I guess that some plugin or custom code is overriding the filters for these admin_url() function. You can debug it if you want. Good luck :)

Upvotes: 1

Related Questions