WPMU Sitewide Tags – Posts don’t show up?

I’m working on a new WordPress Mu site and am using Donncha’s fantastic Sitewide Tags Plugin to pull all the posts from across my network of blogs onto one master blog for indexing features across my site.

One thing I didn’t realize however was that (at the moment) it only works on posts published AFTER you start using it. If you’re like me you have 100s or 1000s or even more posts already in your network.

I stumbled across some code the other day that will iterate through your blogs and pull the existing posts into the new tags blog. So Colas Nahaboo, whoever you are, thanks for this awesome bit of code:

$posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'publish'" );
if ( !empty($posts) ) {
    foreach ( $posts as $post ) {
        if($post != 1 && $post != 2)
            sitewide_tags_post($post, get_post($post));
    }
}

The easy thing to do, is using the WPMU Power Tools plug-in, from Brian Freeman, run the above query exactly as it is across all blogs and within a few seconds all of your posts will be pulled in. Easy!

Thanks to Andrea and Donncha for tips over the past few days, I always appreciate the help.

Leave a Comment




    • Marty has been an active search marketing professional for over 12 years. He has consulted with the Fortune 100 and Fortune 500 as well as medium to small B2B and B2c businesses, governments and higher ed.