I'm currently publishing articles to wordpress as "Private", as I don't want them to be viewable on the website. However I do need an RSS feed of these posts. Any suggestions on how to go about creating an RSS feed of posts that aren't viewable on my site?

1 Answer 1


I assume your theme already has a 'feed-rss.php' (if not, here's how they work: http://codex.wordpress.org/Customizing_Feeds)

You'll need to pass a few parameters to the query before you loop through them.

//Get all posts that are private or public
$the_query = new WP_Query( array( 'post_status' => array( 'private', 'publish' ) );
while ( $the_query->have_posts() ) {
    //do stuff

For more parameters: http://codex.wordpress.org/Class_Reference/WP_Query#Status_Parameters

  • Hmm... I wonder if there is a nicer way to do this with this codex.wordpress.org/… Jul 9, 2013 at 20:40
  • Where should that code be inserted? I set up a custom feed template which is working. However when I insert your code into the feed template I get a 500 error. (Also, your code is missing a close parentheses).
    – Nick5a1
    Jul 9, 2013 at 21:25

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.