GeoDirectory SupportHow to exclude GeoDirectory listings from RSS feed? – GeoDirectory Support https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/feed Mon, 23 Feb 2026 23:08:08 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-15963 <![CDATA[How to exclude GeoDirectory listings from RSS feed?]]> https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-15963 Sat, 20 Sep 2014 13:50:59 +0000 Tom Dear support team,
I have a website, and as part of the website, I am currently building a directory. Currently, every directory listing that is added is also sent out via RSS – which is something I do not want. I do only my content-rich articles to be spread via RSS, not every little directory entry.

I found the following code in the internet, which refers to post categories. Is there a way to alter this code (or is there maybe a function in GD) so that the GeoDirectory post types (for exmple gd_place) are not sent out via RSS?

Thanks a lot,
Tom

((Here’s the code I found:))


function myFeedExcluder($query) {
 if ($query->is_feed) {
   $query->set('cat','-12');
 }
return $query;
}

add_filter('pre_get_posts','myFeedExcluder');
]]>
https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-15972 <![CDATA[Reply To: How to exclude GeoDirectory listings from RSS feed?]]> https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-15972 Sat, 20 Sep 2014 16:14:20 +0000 Simone Hi Tom, you could do something like this:



function myFeedExcluder($query) {
 if ($query->is_feed) {
  $query = new WP_Query( array( 'post_type' => array( 'post', 'page' ) ) );
 }
return $query;
}

add_filter('pre_get_posts','myFeedExcluder');

in this case, $query will have only posts and pages.
Not tested thou, should be working

]]>
https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-16776 <![CDATA[Reply To: How to exclude GeoDirectory listings from RSS feed?]]> https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-16776 Sun, 28 Sep 2014 15:33:05 +0000 Tom Yep, seems to work – thank you!
Cheers,
Tom

]]>
https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-16793 <![CDATA[Reply To: How to exclude GeoDirectory listings from RSS feed?]]> https://wpgeodirectory.com/support/topic/how-to-exclude-geodirectory-listings-from-rss-feed/#post-16793 Sun, 28 Sep 2014 20:30:06 +0000 Simone Awesome!

]]>