WordPress.org

Forums

how to exclude a specific page from rss? (5 posts)

  1. forgetcolor
    Member
    Posted 4 years ago #

    I'm using the BX Page RSS plugin to add my pages into my RSS feed. The code to this plugin is very simple, and I include it below in case it helps.

    What I want to know is how could exclude a specific page from being included in the RSS feed?

    There are plugins out there to exclude specific posts from the feed, but since including pages isn't default behavior, I'm not finding anything to do this.

    Any ideas?

    Here's the code to that plugin:

    <?php
    
    function isl_page_rss($query) {
      if ($query->is_feed) {
        $query->set('post_type', 'any');
      }
      return $query;
    }
    
    add_filter('pre_get_posts', 'isl_page_rss');
    ?>
  2. wpbless
    Member
    Posted 4 years ago #

  3. forgetcolor
    Member
    Posted 4 years ago #

    no, nothing on that page applies

  4. forgetcolor
    Member
    Posted 4 years ago #

    bump. any ideas? is there a way to exclude a page (not a post) from going out in the RSS feed?

  5. 123milliseconds
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags