Skip to content

Instantly share code, notes, and snippets.

@ReticentRobot
Last active December 12, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ReticentRobot/4692710 to your computer and use it in GitHub Desktop.
Save ReticentRobot/4692710 to your computer and use it in GitHub Desktop.
Using $query->set to remove feeds from RSS in Wordpress
// REMOVE CATEGORIES FROM RSS FEEDS
function removeFromRSS($query)
{
if ($query->is_feed)
{
$query->set('cat', '-111,-135,-138,-143'); //comma separate category ids
}
return $query;
}
add_filter('pre_get_posts','removeFromRSS');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment