Recent Posts Plugin. How does one filter out the Hello World welcome Posts for new blogs?

Recent Posts Plugin. How does one filter out the Hello World welcome Posts for new blogs? On my WPMU site if I list all the recent Posts each time a new Blogs made it includes the default Hello World wp post. Can that be filtered out? Thanks

  • Shawn
    • The Crimson Coder

    The recent global posts feed only includes public posts - but doesn't provide a filter that I can see. The easiest solution would be to change your default blog behavior so that the Hello World post is posted as private.

  • Kimberly
    • Champion of Loops

    Hello jsegal!

    Shawn has a great simple solution :slight_smile:

    If you would prefer a different solution then please let us know!



    If the above action did not result in the resolution or common end to this ticket then please feel free to come back here for comment. Just be sure you mark "Not Resolved" to re-open or we might miss it! :slight_smile: Thanks!

  • Shawn
    • The Crimson Coder

    This should work for you. Put it in a new file named 'shawnsstuff.php' (inside PHP tags) in the mu-plugins folder.

    // Shawn's hook to ensure the first post & page are set 'private' on new MS blogs
    function ShawnsPrivatizeNewStuff ( $blogid ) {
      switch_to_blog( $blogid );
      $wpdb->update( $wpdb->posts, array('post_status' => 'private'), array('ID' => '1') );
      $wpdb->update( $wpdb->posts, array('post_status' => 'private'), array('ID' => '2') );
    add_action( 'ShawnsPrivatizeNewStuff', 'wpmu_new_blog', 1, 1 );

    This is vaporcode, which means I didn't actually test it - but it should work exactly as is.

  • aecnu
    • WP Unicorn

    Greetings jsegal,

    It appears this particular topic is now resolved/closed, if you need any further assistance please let us know.

    If it wasn't resolved, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Thank you for being a WPMU Dev member!

    Cheers, Joe :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.