Someone would tell me how i could do so that all posts published on the websites of my network were published on the main site of the network also?

Or more directly, any way of doing a select on which he select all posts of all prefixes wp_2_posts, wp_3_posts infinitely...

1 Answer 1


To iterate through all sites of the network, we need a function like this (it's an adaptation, check the original that's linked there too):

Hierarchical Page Listing of all Pages in a Multisite Network

And when doing the loop, you will switch_to_blog($id) and perform any normal read/write operation. Here's an example of post insertion after a site creation:

WP_INSERT_POST issue on Wordpress Multisite

And here's an experimental plugin I did to publish a post from one site to another. It displays a meta box when editing a post where you can select other site where the same post is to be published. I guess it's a good starting point to develop a custom solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.