WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What's the fastest way to fetch posts/content across a multisite? I had been using SimplePie RSS feeds, but I'm now investigating switch_to_blog(). As switch_to_blog appears to be quite simple to use, I'd much rather use this implementation, but wanted to make sure that it would remain speedy.

share|improve this question

yup it is fast, it would be even better for you to use the WP Transients API to cache your query for a short period.


if($saved = get_site_transient('SOME_SORT_OF_ID')){
    echo $saved;
} else {


    switch_to_blog(x); // x being the blog id your want to switch to
    // Do your quering and echoing here

    restore_current_blog(); // Revert to current blog   

    set_site_transient("SOME_SORT_OF_ID", ob_get_contents(), (60 * 60)); //Save query for one hour

    ob_end_flush(); // Echo and End Buffering      

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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