Home / category / Exclude categories from RSS feed with functions.php
  • How to Exclude categories from RSS feed with functions.php


    Adding this snippet to the functions.php of your wordpress theme will exclude specified categories from RSS feed.

    ( click code to copy )

    wordpress snippet : PHP

    function exclude_cat_wps($query) {
        if ($query->is_feed) {
        return $query;

    ( WordPress codex functions, hooks, in this snippet. )

    query, get_post, get_posts, add_filter, is_feed, wp,
  • Zachary Levine

    Does this take some time to update? I followed these instructions exactly but the category’s posts are still showing up in the RSS2.0 feed.

    • Hi Zachary
      No this should work right away, do you have any other code that may cause this to have problems? RSS related plugins,

  • SY