The Community plugin for The Events Calendar enables you to create a user-friendly event submission form on your website. This form includes various fields, including the event title, description, date & time, image, categories, tags, and more. This flexibility allows users to provide detailed information about their events. However, not all fields may be necessary for every situation.

This article outlines how to customize the submission form by removing unnecessary fields using straightforward code snippets. Whether you aim to enhance user experience or tailor the form to meet specific needs, these snippets will provide the necessary tools.

While it is possible to add PHP code snippets similar to those provided in this article directly to the functions.php file, using a third-party plugin like Code Snippets is recommended.

Removing Fields via Form Layout Filter Hook

The tec_events_community_form_layout filter hook is a powerful tool that controls the layout and available fields in the submission form. Using this filter hook, you can customize the form to suit your specific needs.

The following code allows you to easily modify the list of fields to remove by editing the $fields_to_remove array.

add_filter( 'tec_events_community_form_layout', function ( $fields ) {

	// Define the fields/modules you want to remove
	$fields_to_remove = [
		'image',                    // Event Image
		'event-taxonomy_event',     // Event Categories
		'event-taxonomy_tag',       // Event Tags
		'event-cost',               // Event Cost
		'terms',                    // Terms and Conditions
	];

	// Remove the specified fields/modules
	return array_diff_key( $fields, array_flip( $fields_to_remove ) );

}, 20 );

List of Events Submission Form Fields

Below is a list of fields available in the Community events submission form that you can control with the tec_events_community_form_layout filter hook:

Field KeyDescription
titleEvent Title
descriptionEvent Description
event-datepickersEvent Date & Time Pickers
imageEvent Image
event-taxonomy_eventEvent Categories
event-taxonomy_tagEvent Tags
event-venueEvent Venue
event-organizerEvent Organizer
event-websiteEvent Website URL
event-seriesEvent Series
event-customCustom Fields
event-costEvent Cost
spam-controlSpam Control (reCAPTCHA or similar)
termsTerms and Conditions Acceptance

Removing Event Status Field

The Event Status field allows users to set the status of an event (e.g., Postponed or Moved Online). To remove this field from the submission form, use the following code:

add_filter( 'tribe_community_events_event_status_enabled', '__return_false' );

Removing Virtual Event Field

If you do not want users to leverage the virtual events functionality, you can disable this field with the following code:

add_filter( 'tribe_community_events_virtual_events_integration_enabled', '__return_false' );

For Developers