Exclude events from search results? Post date Home › Forums › Calendar Products › Events Calendar PRO › Exclude events from search results? This topic has 5 replies, 4 voices, and was last updated 11 years ago by Support Droid. Viewing 6 posts - 1 through 6 (of 6 total) Author Posts January 30, 2012 at 11:02 am #14380 PerryParticipant I’d like to exclude events from the search results. How can I achieve this? Thanks. January 30, 2012 at 4:47 pm #14403 RobMember Hi there Perry. This should be doable, but I’m not sure how. Let me see if our dev Jonah can suggest something. January 30, 2012 at 9:44 pm #14416 JonahParticipant Hi Perry, Try adding this to your functions.php file: function exclude_from_search($query) { if ($query->is_search) { $query->set('post_type', 'post'); } return $query; } add_filter('pre_get_posts','exclude_from_search'); January 31, 2012 at 6:26 am #14422 PerryParticipant worked great. thanks so much! January 31, 2012 at 8:45 am #14428 JonahParticipant Awesome! July 3, 2015 at 5:00 pm #975454 Support DroidKeymaster This topic has not been active for quite some time and will now be closed. If you still need assistance please simply open a new topic (linking to this one if necessary) and one of the team will be only too happy to help. Author Posts Viewing 6 posts - 1 through 6 (of 6 total) The topic ‘Exclude events from search results?’ is closed to new replies. → Please verify your API key is correctly entered on the settings