Force a plugin to use single site tables across multiple multisite sites

Hi, a somewhat weird multisite question.

My client wants to have a user 'control panel' on a separate multisite site (site B), with functionality & data from some of the plugins of another site (site A) being 'fed' to it.

Yeah, I know this is not a good idea, sigh. I tried dealing with this by creating custom functions with "switch_to_blog( )"/"do_shortcode", but some shortcodes still result in data being read/written to local site's plugin tables.

Is there a way to force a plugin to use single site tables across multiple multisite sites?


  • Adam Czajczyk

    Hello Silvia,

    I hope you're well today and thank you for your question!

    I'm afraid there's no easy - if any - way to achieve that. Maybe we'll be able to find some workaround, however I'd like to get a better picture of the case first. What I mean is that I'm not quite sure if I correctly understand the question.

    There are two Multisites mentioned but then you attempted to use "switch_to_blog()" function and that suggests different sites but within the same Multisite. Is that one multisite then or two separate multisite installs?

    Can you also please give me an example of the plugin that doesn't work as expected with "switch_t_blog()" in your case?

    Looking forward to your replay,

  • Silvia

    Hello, thanks for replying so quickly :slight_smile:. It's same, single multisite installation, two websites of a single multisite network.

    An example of a plugin - Ultimate Member activity extension shortcode. It displays data from and writes data to local tables, even though the shortcode is handled through switch_to_blog(). "Messages" shortcode doesn't display recent messages either. Interestingly enough, some other extensions such as "Recent Visitors" & "Notifications" work fine. MyCred plugin seems to be fine, too.

  • Adam Czajczyk

    Hello Silvia!

    I don't have access to Ultimate Member unfortunately, as it's a premium plugin. I can see however that it has a "modular" structure - it's based on various extensions. It's quite possible that some of them are coded the way that won't play well with "switch_to_blog()".

    That most likely could be told by looking at the code but, as I mentioned, I unfortunately doesn't have access to it. Have you perhaps tried to ask Ultimate Member/that extension developers for some tips on that? I think that could be worth a shot...

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.