It is easy to search through events via the event search bar on top of every calendar page. By default the search will look for the given string within the event title, the description, and the excerpt.

If you would like to adjust this search functionality so that the search only happens in event titles, then the following snippet can be of help, which will exclude both the content and the excerpt from the search. Place it in your (child) theme’s functions.php file or follow our guide on Best Practices for Implementing Custom Code Snippets.

function tec_search_only_event_title( $search, WP_Query $wp_query ) {
	// Bail when no search term
	if ( empty( $search ) ) {
		return $search;
	}

	// Bail when not searching events
	if ( $wp_query->get( 'post_type' ) !== 'tribe_events' ) {
		return $search;
	}

	global $wpdb;
	$new_search = preg_replace( "/{$wpdb->posts}.post_(content|excerpt) LIKE ('[{}a-zA-Z0-9]+')/", "0", $search );

	return $new_search;
}

add_action( 'posts_search', 'tec_search_only_event_title', 10, 2 );