Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spearsmarketing/5526772 to your computer and use it in GitHub Desktop.
Save spearsmarketing/5526772 to your computer and use it in GitHub Desktop.
Code to remove WordPress category from RSS feed. Add to functions.php
add_filter('pre_get_posts','custom_feed_filter');
function custom_feed_filter($query) {
if( $query->is_feed )
$query->set('cat','-8');
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment