Exclude Custom Post Types from RSS Feeds

Hello everyone,

The following code will exclude 1 category from the RSS feed.

function myFeedExcluder($query) {
 if ($query->is_feed) {
return $query;


I want to modify this code to exclude 8 custom post types that i am using… How can i do this?

Will this make my site slower?

many thanks,