Title: Excluding categories from RSS feed
Last modified: August 18, 2016

---

# Excluding categories from RSS feed

 *  Resolved [ifelse](https://wordpress.org/support/users/ifelse/)
 * (@ifelse)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-rss-feed/)
 * Does anyone have any ideas on how to publish a RSS feed that excludes posts from
   a certain category?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-rss-feed/#post-232109)
 * To hit `?feed` queries, place this in your blog’s root index.php (before the 
   wp-blog-header.php include):
 * `if(isset($_GET['feed'])) {
    $cat=-1; }
 * $cat needs to be assigned a negative value of the category ID to exclude. If 
   instead you point to the various feed scripts (wp-rss2.php etc.), just add in
   each of them:
 * `$cat=-1;`
 *  Thread Starter [ifelse](https://wordpress.org/support/users/ifelse/)
 * (@ifelse)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-rss-feed/#post-232123)
 * Thanks Kafkaesqui, should have thought of that myself:-)
 * For anyone else with the same issue, what you can also do is make an additional
   check on the ‘category_name’ get variable so that this category is not excluded
   from category feeds.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-rss-feed/#post-232128)
 * Translating ifelse’s note into geek:
 * `if(isset($_GET['feed']) && !(isset($_GET['cat']) || isset($_GET['category_name']))){
   
   $cat=-1; }
 *  Thread Starter [ifelse](https://wordpress.org/support/users/ifelse/)
 * (@ifelse)
 * [20 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-rss-feed/#post-232130)
 * _“Translating ifelse’s note into geek”_
    Thanks:-)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Excluding categories from RSS feed’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [ifelse](https://wordpress.org/support/users/ifelse/)
 * Last activity: [20 years, 9 months ago](https://wordpress.org/support/topic/excluding-categories-from-rss-feed/#post-232130)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
