How to remove private posts from RSS feeds?
Private posts are visible only to administrators and editors, but I have found that they are displayed publicly in RSS feeds. How can I remove them from there?
I have this code but it doesn't work:
function removeRssPrivatePost($content)
{
global $post;
if ($post-post_status == 'private') {
return;
}
return $content;
}
add_filter('the_excerpt_rss', 'removeRssPrivatePost');
add_filter('the_content_feed', 'removeRssPrivatePost');