WordPress.org

Ready to get started?Download WordPress

Forums

Excluding categories from RSS (5 posts)

  1. BrianRose
    Member
    Posted 9 years ago #

    Is there a way to exclude more than one category from an RSS feed?

  2. Mark Jaquith
    WordPress Lead Dev
    Posted 9 years ago #

    http://site.com/feed/?cat=-X
    where X equals the category ID number.
    Conversely, if you did http://site.com/feed/?cat=X (no minus sign) you'd get a feed of ONLY that category.

  3. BrianRose
    Member
    Posted 9 years ago #

    Thanks, but as I stated I need to exclude more than one category at a time. The method you described appears to only work for the exclusion of a single category.

  4. davidprince
    Member
    Posted 9 years ago #

    I am not entirely sure but try adding $cat=1,2,3,6; (this example excludes cats 4 and 5) or whatever is appropriate below the following lines in the rss php.
    $blog = 1;
    $doing_rss = 1;

  5. westpointer
    Member
    Posted 9 years ago #

    FYI - I wanted to exclude a certain category (51) from being in the RSS feed for any user. Modifying wp-rss.php to

    $blog=1;
    $doing_rss = 1;
    $cat=-51;

    did the trick!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.