The Events Manager plugin is a powerful, lightweight WordPress plugin useful for doing exactly what its name indicates. It adheres closely to WordPress coding standards which is a huge plus for theme developers. I’ve used it on many sites now and have found it to be very comprehensive and flexible.
I have often used a custom feedblock in a MailChimp campaign to display events and there have been times that I have needed to exclude certain event categories from the event RSS feed.
The events created by Events Manager are actually custom post types (CPT) and WordPress has built-in features for modifying the output on a CPT’s RSS feed.
Excluding the Event Categories from the Feed
To exclude specific event categories from the events feed, start modifying the feed URL by designating the events custom post type. Appending “?post_type=event” to the feed URL (http://example.com/feed/) will only output events in the RSS feed. Now add “&event-categories=-1” to the end of the URL to tell WordPress to output only events NOT in the event category with the ID of 1. Exclude multiple categories by separating the ID’s with a comma. (Not sure how to find the category ID? Follow the tutorial here.)
Your final feed URL should look something like this:
http://example.com/feed/?post_type=event&event-categories=-1,-3,-8
The events RSS feed at that URL will output all events but NOT events in categories 1, 3, and 8.
There are many ways to construct your feed URL to output just the data that you are looking for. Check out some other options on the WordPress Codex here.
This article over at WPBeginner helped me come to this solution.
Leave a Reply