How To Remove Line Breaks From CSV Exports


Would you like to remove the line breaks from CSV exports? For most fields such as Checkboxes and Address form fields you can add a small code snippet to remove these line breaks from your export file. In this tutorial, we’ll show you how!


Simply add this code snippet to your site.

 * Removes line breaks from CSV data
 * @link

function wpf_dev_remove_line_breaks_csv( $export_data, $request_data, $entry ) {
         static function( &$row ) {
            $row = str_replace( "\n", ' ', $row );
      return $export_data;
add_filter( 'wpforms_pro_admin_entries_export_ajax_get_entry_data', 'wpf_dev_remove_line_breaks_csv', 10, 3 );

With this small snippet you've now removed line breaks from the CSV export

Filter Reference: wpforms_pro_admin_entries_export_ajax_get_entry_data