//For Donncha's Sitewide Tags plugin: Populate tags blog with all posts made before the plugin was added $posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'publish'" ); if ( !empty($posts) ) { foreach ( $posts as $post ) { $post_id = $post['ID']; if($post_id != 1 && $post_id != 2) sitewide_tags_post($post_id, get_post($post_id)); } }