WordPress: Exclude a category from the RSS Feed?

simpleinbound seo Wordpress: Exclude a category from the RSS Feed?1- Get the category # of the category you want “excluded” form your RSS feed
(note: in my example my category was “movies” which had a category number of 12)

2- open & edit  the “functions.php” file

3- add the following code below to the bottom of your functions.php file
(also make sure you replace the -12 with the # from step 1, add a – sign to it also)

4- Save functions.php file

4- want exclude MORE? then add more categories with commas between

 function myFeedExcluder($query) {
  if ($query->is_feed) {
    $query->set(‘cat’,'-12′);
  }
 return $query;
 }
add_filter(‘pre_get_posts’,'myFeedExcluder’);

pixel Wordpress: Exclude a category from the RSS Feed?
Be Sociable, Share!
  • more Wordpress: Exclude a category from the RSS Feed?
This entry was posted in Wordpress and tagged , , . Bookmark the permalink.
If you would like to stay current on our Inbound Marketing Techniques, make sure to:
Subscribe to the RSS Feed!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>