How to Exclude K2 Categories from Search Results
One of my clients uses FeedGator, a wonderful rss feed component for her large Joomla 2.5 site. Using FeedGaror's integration with K2, we have set up the feeds to display on the home page using the K2 Content Module, which shows an introtext and a "read more" for the first batch of feeds.
Our challenge has been finding a solution to exclude those feeds from site search results. In a way, the enhanced search capabilities of Joomla 2.5 work a little too well, since indexing the site content makes internal searches extremely accurate and thorough. Displaying news feeds in search results is obviously counterproductive since those links will take visitors off-site. There were some other issues with the default search due in part to the very complex nature of the site functionality (several hundreds of K2 items, Community Builder with all the bells and whistles, Kunena, etc.).
Judging from the threads in K2 and Joomla forums, there is widespread demand for some kind of K2 category exclusion feature. Our solution requires adding one line of code. Here's how we did it.