Posts Tagged ‘ X Exclude Categories from WP RSS Feed ’

Disable Categories from WP RSS

To continue this process you must know the ID of category(find Category ID)
once you find the category Id which you want to exclude from your RSS follow steps
1. Open Function.php which you can find in your theme directory. If your theme doesn’t have , create one
2. Create filter like the follwing Way

function myFilter($query) {
if ($query->is_feed) {
$query->set(‘cat’,’-5′);
//Don’t forget to change the category ID =^o^=(in this 5 is the ID.) Keep ‘-‘ before the cat ID
}
return $query;
}

This filter excludes category from feed
3. Apply this filter to your Theme using ‘add_filter’ function

add_filter(‘pre_get_posts’,’myFilter’);