Export the Attendee List with Registration Fields

If you need to export an attendee list that includes all registration fields, simply exporting from the Attendees menu under the Tickets section may not capture all the data. Instead, follow the steps below to ensure your export includes attendee responses to all custom fields. This method ensures that all registration field data is included in the export, providing a complete and detailed attendee list with relevant responses. It allows for an easy and structured way to retrieve attendee data while maintaining an accurate record of event registrations.

1. Go to your WordPress dashboard and navigate to Events > Events. Find the event for which you want to export the attendee data.

2. Hover over the event and click on Attendees. This will take you to the list of attendees for that specific event.

3. On the Attendees page, look for the Export button. Clicking this will generate a CSV file that includes all attendee details along with their responses to any registration fields, such as additional questions added via ticket fieldsets.

Add Columns for Attendee Registration Information

When we use additional fields for the Attendee Information Collection using the Event Tickets Plus plugin, sometimes we will want to see this information as a new column in the Attendees list for each event.

As an example for this guide, let’s add a “Company” text field to an event ticket:

The Event’s attendees will see this new field on their registration form and could provide this information:

But when we see the Attendee List, we don’t see this information on the table:

The Snippet

Carefully insert the following PHP code at the end of the functions.php theme file (ensure not to overwrite any existing code there) or by using the Code Snippets plugin:

add_filter ( 'tribe_events_tickets_attendees_table_column', function ( $value, $item, $column ) {
	if ($column === 'Company') {
		 $value = $item['company'];
	}
	return $value;
}, 100, 3 );

add_filter( 'manage_tribe_events_page_tickets-attendees_columns', function ( $column_headers ) { 
    //create a  new set of column headers 
    $new_column_headers = []; 
	foreach ( $column_headers as $column_key => $column_name ) { 
		$new_column_headers[$column_key] = $column_name; 
		//Add order_date immediately after the ticket column 
		if ( 'ticket' == $column_key ) { 
			$new_column_headers['company'] = 'Company'; 
		} 
	}
	return $new_column_headers;
});

Don’t forget to replace the name of the field you are using (‘company’ in this example).

After saving these changes, we should see a new custom column on the Event Attendees list:

We hope you’ve found this helpful, but if you need further assistance, please feel free to reach out to us at our help desk – good luck!

Display Security Code

Carefully insert the following PHP code at the end of the functions.php theme file (ensure not to overwrite any existing code there) or by using the Code Snippets plugin:

add_filter ( 'tribe_events_tickets_attendees_csv_export_columns', function( $columns ) {
	$columns['security_code'] = 'Security Code';
	return $columns;
} );

add_filter ( 'tribe_events_tickets_attendees_table_column', function ( $value, $item, $column ) {
	if ($column === 'security_code') {
		 $value = $item['security_code'];
	}
	return $value;
}, 100, 3 );

add_filter( 'manage_tribe_events_page_tickets-attendees_columns', function ( $column_headers ) { 
    //create a  new set of column headers 
    $new_column_headers = []; 
	foreach ( $column_headers as $column_key => $column_name ) { 
		$new_column_headers[$column_key] = $column_name; 
		//Add order_date immediately after the ticket column 
		if ( 'ticket' == $column_key ) { 
			$new_column_headers['security_code'] = 'Security Code'; 
		} 
	}
	return $new_column_headers;
});

After you have inserted the code and saved it:

  • Go to the Attendees section under the Event Tickets menu in your admin panel.
  • Verify that the columns for Security Code and Ticket ID are now present.
  • Check a few entries to ensure that the columns are populating correctly.

Here’s a screenshot showing how it should appear on your end, taken from one of our tests when using that snippet:

Show Registration and Purchase Details

The following code will show the time of registration / purchase of an RSVP / ticket on the attendee list of an event. Copy the below code into your (child) theme’s functions.php file (or wherever you usually put custom code).

<pre class="wp-block-syntaxhighlighter-code">
add_action( 'event_tickets_attendees_table_ticket_column', 'add_registration_time_to_attendee_details' );
function add_registration_time_to_attendee_details( $item ) {

	if ( ! isset( $item&#x5B;'order_id'] ) ) {
		return;
	}

	if ( $item&#x5B;'provider_slug'] == 'woo' ) {
		$order_id = $item&#x5B;'qr_ticket_id'];
	}
	else {
		$order_id = $item&#x5B;'order_id'];
	}

	$registration_time = get_the_date( 'F j, Y', $order_id );

	if ( empty( $registration_time ) ) {
		return;
	}

	printf( '&amp;lt;div class=&amp;quot;event-tickets-ticket-registration-time&amp;quot;&amp;gt;%1$s:&amp;lt;br/&amp;gt;%2$s&amp;lt;/div&amp;gt;', esc_html__( 'Registration Time', 'tribe-extension' ), sanitize_text_field( $registration_time ) );
}
</pre>

Add WooCommerce Order Data

If you’re using Event Tickets Plus with WooCommerce, you may find it helpful to have WooCommerce order data in your Attendee list—for example, when processing offline payments and checking in attendees at the venue, you may want to know the Payment Method used by the attendee. By default, the attendee list only includes basic attendee information and does not include billing details.

Using this guide you can add any WooCommerce order data to your attendee export.

The code is designed for easy customization to fit your needs. To choose which fields appear in your attendee export, simply edit the $fields array at the top of the code. This list is what tells the rest of the code what values to pull in and put in the columns. It is the only part of the code that you need to edit.

We’ve pre-populated this list with the most common WooCommerce fields you might need. This saves you from having to look up each field name. Just delete any fields you don’t want from the list, and the code will automatically update the export for you.

NOTE: This is just part of the code used for explaining how it works – you will need to edit the full code found below for this to work.

$fields = [
    'order_id'       => 'Order ID',
    'order_number'   => 'Order Number',
    'order_date'     => 'Order Date',
    'payment_method' => 'Payment Method',
    'transaction_id' => 'Transaction ID',
    'order_status'   => 'Order Status',
    'billing_name'   => 'Billing Name',
    'billing_email'  => 'Billing Email',
    'billing_phone'  => 'Billing Phone',
    'billing_address'=> 'Billing Address',
    'shipping_address'=> 'Shipping Address',
    'order_total'    => 'Order Total',
    'coupon_codes'   => 'Coupon Codes',
];

Using the example at the start, of needing to know the Payment Method that was used, the list would look like this:

$fields = [
'payment_method' => 'Payment Method',
];

And this is how it would look like on the export.

The Snippet

add_filter( 'tribe_events_tickets_attendees_csv_export_columns', function( $columns ) {
    // This defines the fields you want to add. Please remove the ones you don't want in the export.
    $fields = [
        'order_id'       => 'Order ID',
        'order_number'   => 'Order Number',
        'order_date'     => 'Order Date',
        'payment_method' => 'Payment Method',
        'transaction_id' => 'Transaction ID',
        'order_status'   => 'Order Status',
        'billing_name'   => 'Billing Name',
        'billing_email'  => 'Billing Email',
        'billing_phone'  => 'Billing Phone',
        'billing_address'=> 'Billing Address',
        'shipping_address'=> 'Shipping Address',
        'order_total'    => 'Order Total',
        'coupon_codes'   => 'Coupon Codes',
    ];

    return array_merge( $columns, $fields );
} );

add_filter( 'tribe_events_tickets_attendees_table_column', function( $value, $item, $column ) {
    // This static variable acts as the cache. It retains its value between function calls.
    static $order_cache = [];

    if ( empty( $item['order_id'] ) ) {
        return $value;
    }

    if ( ! isset( $order_cache[ $item['order_id'] ] ) ) {
        $order_cache[ $item['order_id'] ] = wc_get_order( $item['order_id'] );
    }
    
    $order = $order_cache[ $item['order_id'] ];

   
    if ( ! $order ) {
        return $value;
    }
    
    switch ( $column ) {
        case 'order_id':
            return $order->get_id();
        case 'order_number':
            return $order->get_order_number();
        case 'order_date':
            return $order->get_date_created() ? $order->get_date_created()->date( 'Y-m-d H:i' ) : '';
        case 'payment_method':
            return $order->get_payment_method_title();
        case 'transaction_id':
            return $order->get_transaction_id();
        case 'order_status':
            return $order->get_status();
        case 'billing_name':
            return $order->get_formatted_billing_full_name();
        case 'billing_email':
            return $order->get_billing_email();
        case 'billing_phone':
            return $order->get_billing_phone();
        case 'billing_address':
            return $order->get_formatted_billing_address();
        case 'shipping_address':
            return $order->get_formatted_shipping_address();
        case 'order_total':
            return $order->get_total();
        case 'coupon_codes':
            return implode( ', ', $order->get_coupon_codes() );
        default:
            return $value;
    }

}, 10, 3 );

To learn how to add custom code snippet to your site, you can use our guide here.

Finding Other Fields

In most cases, the fields listed above will be enough. However, if you need any other order field in the export, you can add your own.

The code uses the WC_Order object, which is the official way to access all order data in WooCommerce.

For standard WooCommerce fields: You can find a comprehensive list of all available methods and properties on the official WooCommerce WC_Order Class Reference page. Look for methods that start with get_ (like get_billing_phone(), get_total(), etc.). The name after get_ is what you should use as the key in the $fields array.

For example, if you want to have the Billing Country on the column, in the reference linked above, we see that there is a get_billing_country()  function. Since we need to remove the get_ – we end up with only billing_country. To add this to the list, it should be formatted like this:

‘billing_country’ => ‘Billing Country’,

After this, you will need to add a case in the switch statement in the second part of the code. For billing country, you need to add:

        case 'billing_country':
            return $order->get_billing_country();

Just before default statement:

    default:
        return $value;
}

Using Custom Fields

For custom fields: Many plugins and custom code snippets add data to an order using “meta keys.” These are often prefixed with an underscore (_), but not always.

To find these keys, the best way is to look at the raw order data. You can often find this in the WordPress dashboard: go to WooCommerce > Orders, select an order, and look for a “Custom Fields” section.

Once you know the meta key (e.g., _my_custom_field), you can retrieve its value using the $order->get_meta() function. The case for this would look like:

case 'my_custom_field':
    return $order->get_meta('_my_custom_field');

Then add it in the $fields array:

'my_custom_field' => 'My Custom Field Name',

Important: The key you define in the $fields array (my_custom_field in the example above) must match the case statement in the code.