Merging duplicate venues and organizers is a great way to ensure that your data hasn’t been repeated on your WordPress site. You can find this setting under Events Setting > General. This scenario may come up when managing user-submitted events with Community Events and users submit venues and organizers as new ones multiple times.

We’ve added some filters to provide you with more control over how your venues and organizers are merged.

Merging duplicate venues and organizers with a filter

  • tribe_merge_identical_organizers_enabled
  • tribe_merge_identical_venues_enabled
  • tribe_merge_identical_organizers_fields
  • tribe_merge_identical_venues_fields
  • tribe_amalgamate_venues_keep_venue
  • tribe_amalgamate_organizers_keep_organizer

Example snippet

You can use the above filters to customize the venues and organizers that are merged as duplicates. Here’s an example snippet of how to implement these filters:

add_filter( 'tribe_merge_identical_venues_fields', 'custom_merge_identical_venues_fields', 20, 1);
function custom_merge_identical_venues_fields( $data ) {
	// Merge venues that have the same title, address, city and country.
	$data = [
		'title'				=> $data['title'],
		'_VenueAddress'		=> $data['_VenueAddress'],
		'_VenueCity'		=> $data['_VenueCity'],
		'_VenueCountry'		=> $data['_VenueCountry']
	];

	return $data;
}