Last active
December 12, 2015 01:39
-
-
Save ReticentRobot/4692710 to your computer and use it in GitHub Desktop.
Using $query->set to remove feeds from RSS in Wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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