Skip to content
GravityKit
Buy
Sign in
0 items
  • Plugins

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    Ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Plugins

    • GravityView

      GravityView

      Bestseller

      Display Gravity Forms entries on the front-end of your site and build powerful web applications.

    • GravityImport

      GravityImport

      Trending

      Import entries from CSV files into Gravity Forms to transfer data, create new forms, or update existing entries.

    • GravityEdit

      GravityEdit

      Quickly edit Gravity Forms entries inline to save time, reduce clicks, and streamline your workflow.

    • GravityCharts

      GravityCharts

      Trending

      Turn Gravity Forms entries into interactive charts and graphs.

    • GravityActions

      GravityActions

      Update multiple Gravity Forms entries at once, send bulk emails, and streamline your workflow.

    • GravityCalendar

      GravityCalendar

      Turn Gravity Forms entries into dynamic calendars to showcase events, schedules, appointments, and more.

    • GravityExport

      GravityExport

      Export Gravity Forms entries to Excel, CSV, or PDF and share them instantly with secure download links.

    • GravityMath

      GravityMath

      Perform advanced calculations on Gravity Forms entries to display totals, averages, or build custom calculators.

    • GravityRevisions

      GravityRevisions

      Track, compare, and restore changes made to Gravity Forms forms and entries with a full version history.

    • GravityMigrate

      GravityMigrate

      Migrate all Gravity Forms data, including forms, entries, Views, feeds, uploads, and more.

    • GravityBoard

      GravityBoard

      Manage projects with collaborative project management. Coordinate with your team and streamline your workflows.

    GravityKit All Access

    Our complete Kit of essential tools for extending and enhancing Gravity Forms—everything you need to build powerful web apps and workflows.

    Learn more
  • Ideal For

    • Nonprofits
    • Startups
    • Education
    • Web Agencies
    • Developers
    • Government iconGovernment
    Explore All Use Cases

    Case studies

    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    • Mediebruket
    • Dragonfly
    View All Case Studies

    How to build...

    • Property Management
    • Product Catalog
    • Fundraising Dashboard
    • Real Estate Directory
    • Document Library
    • Academic Journal
    • Volunteer Management
    • Meal Tracker
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Support
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy
    • GravityKit Live!

    ultimate guides

    • How to use Gravity Forms
    • Editing Gravity Forms entries
    • Importing Gravity Forms entries
    • Exporting Gravity Forms entries
    • Displaying Gravity Forms entries
    • Gravity Forms conditional logic
    • Gravity Forms calculations
    View More Articles
  • Pricing
  • About
0 items

Search

Results appear automatically as you type.
Loading results…

results found matching

    Sign in
    Buy

    Docs

    • Docs Home

    Gravity Forms Add-Ons

    • GravityView
    • GravityActions
    • GravityBoard
    • GravityCalendar
    • GravityCharts
    • GravityEdit
    • GravityExport
    • GravityImport
    • GravityMath
    • GravityMigrate
    • GravityRevisions
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GF Zero Spam
    • GravityExport Lite

    GravityView

    • Getting Started
    • View Setup
    • FAQ
    • Pre-Sale
    • Advanced
    • Common Problems
    • Customizing Your Views
    • Edit Entry
    • Entry Approval
    • Filter and Sort Results
    • Gravity Forms
    • Merge Tags
    • Roles and Capabilities
    • Search
    • Shortcodes
    • View Settings
    • WordPress Posts

    General Help

    • Account, Invoices, and Billing
    • License Related
    • Plugins and Settings
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityMigrate
      • GravityRevisions
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GF Zero Spam
      • GravityExport Lite
    • GravityView

      • Getting Started
      • View Setup
      • FAQ
      • Pre-Sale
      • Advanced
      • Common Problems
      • Customizing Your Views
      • Edit Entry
      • Entry Approval
      • Filter and Sort Results
      • Gravity Forms
      • Merge Tags
      • Roles and Capabilities
      • Search
      • Shortcodes
      • View Settings
      • WordPress Posts
    • General Help

      • Account, Invoices, and Billing
      • License Related
      • Plugins and Settings
    • Contact

    GravityExport

    • Adding a download button for entries in GravityView using GravityExport
    • Attaching all entries to an e-mail in GravityExport
    • Attaching an entry export to a notification using GravityExport Lite
    • Changing labels in GravityExport
    • Changing the File Format of a Report by Adding the File Extension to the URL
    • Changing values in GravityExport
    • Connecting Dropbox to GravityExport
    • Connecting FTP to GravityExport
    • Customize Download URLs in GravityExport
    • Filtering entries included in a GravityExport download
    • Filtering GravityExport with conditional logic and relative dates
    • Formatting an address in GravityExport
    • Getting started with GravityExport
    • GravityExport and caching plugins
    • GravityExport Developer Hooks
    • GravityExport FAQ
    • GravityExport field: BaseField
    • GravityExport field: DateField
    • GravityExport field: FileUploadField
    • GravityExport field: ListField
    • GravityExport field: MetaField
    • GravityExport field: NotesField
    • GravityExport field: NumberField
    • GravityExport field: ProductField
    • GravityExport field: RepeaterField
    • GravityExport field: SectionField
    • GravityExport field: SeparableField
    • GravityExport Filters
    • GravityExport: Exporting only one entry
    • GravityExport: How to output dropdown field labels Instead of values
    • GravityExport: Splitting complex fields in Multiple Columns
    • GravityExport: The “Enable multi-row splitting” setting
    • How Is GravityExport Lite Different From GravityExport?
    • How to configure GravityExport to save File Upload fields
    • How to export all forms in bulk to an Excel spreadsheet
    • How to Export Checkbox Fields as Separate Columns in GravityExport
    • How to re-run a GravityExport Save feed
    • How to schedule automated exports
    • How to trigger a GravityExport Save Feed
    • How to use FastCron to trigger exports on a custom schedule
    • PDF export settings and style controls
    • Restricting file access in GravityExport & GravityExport Lite
    • Styling PDF file exports using CSS
    • Home
    • Docs
    • GravityExport
    • GravityExport Developer Hooks

    GravityExport Developer Hooks

    Estimated reading: 21 minutes

    Updated on April 24, 2026

    These are the developer hooks available GravityKit Lite and GravityExport. All code is provided as examples and should be tested before being used. See how to add custom PHP to your site.

    Most hooks use gf_apply_filters() , so they are also available with _{form_id}  added to the filter name (example: gfexcel_renderer_matrix_{form_id}). Using the form filters will only modify values associated with that specific form.


    gfexcel_renderer_matrix #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Modify the export matrix before it’s rendered. The matrix is a two-dimensional array containing header row and all entry data rows.

    PropertyTypeDefaultDescription
    $matrix array N/ATwo-dimensional array with row 0 as header, rows 1+ as data
    $form array N/AGravity Forms form object

    Matrix Structure

    The matrix is a two-dimensional array where:

    • Row 0 (Header): Contains column header objects (GFExcelValuesStringValue  )
    • Row 1+ (Data): Contains entry data as value objects

    Each cell in the matrix is an implementation of the GFExcelValuesBaseValue  object, for example:

    • GFExcelValuesStringValue   – Text values
    • GFExcelValuesNumericValue   – Numeric values (Entry ID, User ID, etc.)

    Value Object Properties

    All value objects extend from a base class and include:

    PropertyTypeAccessDescription
    value  mixed  protected  The actual cell value
    gf_field  GF_Field  protected  Associated Gravity Forms field object
    is_numeric  bool  protected  Whether value should be formatted as number
    color  string  protected  Text color
    background_color  string  protected  Cell background color
    is_bold  bool  protected  Bold formatting
    is_italic  bool  protected  Italic formatting
    url  string  protected  Hyperlink URL

    Removing columns with only empty values

    This code filters out columns from being included in the export where all the values in the column are empty.

    /**
     * Remove empty columns from the matrix.
     *
     * Filters out columns where all values (excluding the header) are empty.
     *
     * @since 1.0.0
     *
     * @param array $matrix The matrix containing all rows and columns. First row is the header.
     * @param array $form   The form object (unused; required by filter signature).
     *
     * @return array The matrix with empty columns removed.
     */
    function gfexcel_remove_empty_columns( $matrix, $form ) {
    	if ( empty( $matrix ) || count( $matrix ) < 2 ) {
    		return $matrix; // Need header + at least one data row.
    	}
    
    	/**
    	 * Determine whether a cell value should be considered empty.
    	 *
    	 * Preserves 0, '0', 0.0, and false as non-empty.
    	 *
    	 * @param mixed $value The value to check.
    	 * @return bool
    	 */
    	$is_empty = static function( $value ): bool {
    		// Unwrap GFExcel value objects.
    		if ( is_object( $value ) && method_exists( $value, 'getValue' ) ) {
    			$value = $value->getValue();
    		}
    
    		// Empty arrays are empty; non-empty arrays are not.
    		if ( is_array( $value ) ) {
    			return count( $value ) === 0;
    		}
    
    		if ( is_string( $value ) ) {
    			return '' === trim( $value );
    		}
    
    		return $value === null || $value === '';
    	};
    
    	$data_rows       = array_slice( $matrix, 1 );
    	$column_count    = count( $matrix[0] );
    	$columns_to_keep = [];
    
    	// Find columns with at least one non-empty value.
    	for ( $col_index = 0; $col_index < $column_count; $col_index++ ) {
    		foreach ( $data_rows as $row ) {
    			$val = $row[ $col_index ] ?? null;
    
    			if ( ! $is_empty( $val ) ) {
    				$columns_to_keep[] = $col_index;
    				continue 2; // Skip to next column.
    			}
    		}
    	}
    
    	// Rebuild matrix keeping only non-empty columns.
    	if ( empty( $columns_to_keep ) ) {
    		// All columns empty: return empty rows with no columns.
    		return array_fill( 0, count( $matrix ), [] );
    	}
    
    	$keep_flip = array_flip( $columns_to_keep );
    
    	return array_map(
    		static function( $row ) use ( $keep_flip ) {
    			return array_values( array_intersect_key( $row, $keep_flip ) );
    		},
    		$matrix
    	);
    }
    
    add_filter( 'gfexcel_renderer_matrix', 'gfexcel_remove_empty_columns', 10, 2 );

    Removing the header row

    If you want to remove the header row from GravityKit export, add this code to your site. This will remove the first row.

    /**
     * Remove the values from the first row of the matrix. The columns still exist, but the values are empty. This removes the first (header) row.
     * @param mixed[] $matrix The matrix containing all rows and columns.
     * @return mixed[] The matrix containing all rows and columns.
     */
    add_filter( 'gfexcel_renderer_matrix', function( $matrix ) {
      unset( $matrix[0] ); // Unset the first row. Doesn't remove the row, only the values.
      return array_values( $matrix ); // Re-indexes the array to start at 0, removing the first row.
    }, 10, 1 );

    gfexcel_renderer_hide_row #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Hide specific rows from the export based on custom logic.

    PropertyTypeDefaultDescription
    $hide bool false Whether to hide the row
    $row array N/AArray of cell values for the current row
    $form_id int N/AThe form ID

    Sample code

    /**
     * Hide rows where field 1 is empty.
     *
     * @param bool  $hide    Whether to hide the row.
     * @param array $row     The row data.
     * @param int   $form_id The form ID.
     * @return bool True to hide the row.
     */
    function gravityexport_hide_empty_field_rows( $hide, $row, $form_id ) {
        foreach ( $row as $column ) {
            if ( 1 === $column->getFieldId() && empty( $column->getValue() ) ) {
                return true;
            }
        }
    
        return $hide;
    }
    add_filter( 'gfexcel_renderer_hide_row', 'gravityexport_hide_empty_field_rows', 10, 3 );

    gfexcel_renderer_columns_max_width #

    Applies to: Excel (.xlsx), PDF (.pdf)

    Set the maximum width for auto-sized columns in the export.

    PropertyTypeDefaultDescription
    $max_width int|null null Maximum column width in Excel units (null = no limit)

    Sample code

    /**
     * Limit column width to 50 units.
     *
     * @param int|null $max_width The maximum column width.
     * @return int The new maximum width.
     */
    function gravityexport_set_max_column_width( $max_width ) {
        return 50;
    }
    add_filter( 'gfexcel_renderer_columns_max_width', 'gravityexport_set_max_column_width' );

    gfexcel_renderer_wrap_text #

    Applies to: Excel (.xlsx), PDF (.pdf)

    Control whether cell text should wrap.

    PropertyTypeDefaultDescription
    $wrap_text bool true Whether to wrap text in cells
    $cell Cell N/APhpSpreadsheet Cell object
    $value BaseValue|mixed N/AThe cell value object or raw value
    $form_id int N/AThe form ID

    Sample code

    /**
     * Disable text wrapping for all cells.
     *
     * @param bool  $wrap_text Whether to wrap text.
     * @param Cell  $cell      The cell object.
     * @param mixed $value     The cell value.
     * @param int   $form_id   The form ID.
     * @return bool False to disable text wrapping.
     */
    function gravityexport_disable_text_wrap( $wrap_text, $cell, $value, $form_id ) {
        return false;
    }
    add_filter( 'gfexcel_renderer_wrap_text', 'gravityexport_disable_text_wrap', 10, 4 );

    gfexcel_renderer_worksheet_title #

    Applies to: Excel (.xlsx), PDF (.pdf)

    Customize the worksheet/tab name in the Excel file, or the document title in PDF exports.

    PropertyTypeDefaultDescription
    $title string Form titleWorksheet title (max 30 characters)
    $form array N/AThe form object
    $form_id int N/AThe form ID

    Sample code

    /**
     * Add form ID to worksheet title.
     *
     * @param string $title   The worksheet title.
     * @param array  $form    The form object.
     * @param int    $form_id The form ID.
     * @return string Modified worksheet title.
     */
    function gravityexport_custom_worksheet_title( $title, $form, $form_id ) {
        return sprintf( 'Form %d - %s', $form_id, $title );
    }
    add_filter( 'gfexcel_renderer_worksheet_title', 'gravityexport_custom_worksheet_title', 10, 3 );

    gfexcel_renderer_disable_hyperlinks #

    Applies to: Excel (.xlsx), PDF (.pdf)

    Disable hyperlinks in the export globally.

    PropertyTypeDefaultDescription
    $disable bool false Whether to disable all hyperlinks

    Sample code

    /**
     * Disable all hyperlinks in export.
     *
     * @return bool True to disable hyperlinks.
     */
    add_filter( 'gfexcel_renderer_disable_hyperlinks', '__return_true' );

    gfexcel_output_rows #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Modify the rows before they’re processed into the matrix.

    PropertyTypeDefaultDescription
    $rows array N/AArray of entry rows
    $form array N/AThe form object
    $form_id int N/AThe form ID

    Sample code

    /**
     * Filter out test entries from export.
     *
     * @param array $rows    The entry rows.
     * @param array $form    The form object.
     * @param int   $form_id The form ID.
     * @return array Filtered rows.
     */
    function gravityexport_remove_test_entries( $rows, $form, $form_id ) {
        return array_filter( $rows, function( $row ) {
            // Remove entries with "test" in field 1
            return false === stripos( $row[1], 'test' );
        } );
    }
    add_filter( 'gfexcel_output_rows', 'gravityexport_remove_test_entries', 10, 3 );

    gfexcel_output_columns #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Modify which columns are included in the export.

    PropertyTypeDefaultDescription
    $columns array N/AArray of column field objects
    $form array N/AThe form object
    $form_id int N/AThe form ID

    Sample code

    /**
     * Remove specific columns from export.
     *
     * @param array $columns The column fields.
     * @param array $form    The form object.
     * @param int   $form_id The form ID.
     * @return array Modified columns.
     */
    function gravityexport_remove_admin_columns( $columns, $form, $form_id ) {
        return array_filter( $columns, function( $column ) {
            // Remove admin-only fields
            return ! in_array( $column->id, [ 'ip', 'user_agent' ], true );
        } );
    }
    add_filter( 'gfexcel_output_columns', 'gravityexport_remove_admin_columns', 10, 3 );

    gfexcel_output_search_criteria #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Modify the search criteria used to fetch entries for export.

    PropertyTypeDefaultDescription
    $search_criteria array ['status' => 'active'] GFAPI search criteria array
    $form_id int N/AThe form ID
    $feed_id int N/AThe feed ID (if applicable)

    Sample code

    /**
     * Only export entries from last 30 days.
     *
     * @param array $search_criteria The search criteria.
     * @param int   $form_id         The form ID.
     * @param int   $feed_id         The feed ID.
     * @return array Modified search criteria.
     */
    function gravityexport_last_30_days( $search_criteria, $form_id, $feed_id ) {
        $search_criteria['start_date'] = date( 'Y-m-d', strtotime( '-30 days' ) );
        $search_criteria['end_date']   = date( 'Y-m-d' );
    
        return $search_criteria;
    }
    add_filter( 'gfexcel_output_search_criteria', 'gravityexport_last_30_days', 10, 3 );

    gfexcel_output_sorting_options #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Customize how entries are sorted in the export.

    PropertyTypeDefaultDescription
    $sorting array ['key' => 'date_created', 'direction' => 'ASC'] Sorting configuration
    $form_id int N/AThe form ID
    $feed_id int N/AThe feed ID (if applicable)

    Sample code

    /**
     * Sort by entry ID descending.
     *
     * @param array $sorting The sorting options.
     * @param int   $form_id The form ID.
     * @param int   $feed_id The feed ID.
     * @return array Modified sorting options.
     */
    function gravityexport_sort_by_id_desc( $sorting, $form_id, $feed_id ) {
        return [
            'key'       => 'id',
            'direction' => 'DESC',
        ];
    }
    add_filter( 'gfexcel_output_sorting_options', 'gravityexport_sort_by_id_desc', 10, 3 );

    gfexcel_field_checkbox_empty #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Define the value to use for empty checkbox fields.

    PropertyTypeDefaultDescription
    $empty_value string '' Value to use for unchecked checkboxes
    $field GF_Field N/AThe checkbox field object
    $form_id int N/AThe form ID

    Sample code

    /**
     * Use "No" for empty checkboxes.
     *
     * @param string   $empty_value The empty value.
     * @param GF_Field $field       The field object.
     * @param int      $form_id     The form ID.
     * @return string The new empty value.
     */
    function gravityexport_checkbox_empty_no( $empty_value, $field, $form_id ) {
        return 'No';
    }
    add_filter( 'gfexcel_field_checkbox_empty', 'gravityexport_checkbox_empty_no', 10, 3 );

    gfexcel_field_date_format #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Customize the date format for date fields in the export.

    PropertyTypeDefaultDescription
    $format string Field formatPHP date format string
    $field GF_Field N/AThe date field object
    $form_id int N/AThe form ID
    $input_id string N/AThe input ID (for multi-input fields)

    Sample code

    /**
     * Use ISO 8601 date format.
     *
     * @param string   $format   The date format.
     * @param GF_Field $field    The field object.
     * @param int      $form_id  The form ID.
     * @param string   $input_id The input ID.
     * @return string The new date format.
     */
    function gravityexport_iso_date_format( $format, $field, $form_id, $input_id ) {
        return 'Y-m-d';
    }
    add_filter( 'gfexcel_field_date_format', 'gravityexport_iso_date_format', 10, 4 );

    gfexcel_combiner_glue #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Customize the separator used when combining multi-value fields.

    PropertyTypeDefaultDescription
    $glue string ', ' String used to join multiple values
    $field_type string N/AThe field type (e.g., ‘checkbox’, ‘multiselect’)
    $field_id int N/AThe field ID
    $form_id int N/AThe form ID

    Sample code

    /**
     * Use semicolon separator for checkbox fields.
     *
     * @param string $glue       The separator string.
     * @param string $field_type The field type.
     * @param int    $field_id   The field ID.
     * @param int    $form_id    The form ID.
     * @return string The new separator.
     */
    function gravityexport_semicolon_separator( $glue, $field_type, $field_id, $form_id ) {
        if ( 'checkbox' === $field_type ) {
            return '; ';
        }
    
        return $glue;
    }
    add_filter( 'gfexcel_combiner_glue', 'gravityexport_semicolon_separator', 10, 4 );

    gfexcel_file_extension #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Set the file extension/format for a specific form’s exports.

    PropertyTypeDefaultDescription
    $extension string 'xlsx' File extension (‘xlsx’, ‘csv’, or ‘pdf’)
    $form array N/AThe form object

    Sample code

    /**
     * Use CSV format for form ID 5.
     *
     * @param string $extension The file extension.
     * @param array  $form      The form object.
     * @return string The file extension.
     */
    function gravityexport_csv_for_form_5( $extension, $form ) {
        if ( 5 === (int) rgar( $form, 'id' ) ) {
            return 'csv';
        }
    
        return $extension;
    }
    add_filter( 'gfexcel_file_extension', 'gravityexport_csv_for_form_5', 10, 2 );

    gfexcel_file_extensions #

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Register available file format extensions that the plugin recognizes.

    PropertyTypeDefaultDescription
    $extensions array ['xlsx', 'csv'] Array of supported extensions

    Sample code

    /**
     * Add custom export format.
     *
     * @param array $extensions Supported extensions.
     * @return array Modified extensions array.
     */
    function gravityexport_add_custom_format( $extensions ) {
        $extensions[] = 'ods'; // OpenDocument Spreadsheet
    
        return $extensions;
    }
    add_filter( 'gfexcel_file_extensions', 'gravityexport_add_custom_format' );

    CSV-Specific Filters #

    The following filters only apply to CSV (.csv) exports.

    gfexcel_renderer_csv_delimiter

    Applies to: CSV (.csv) only

    Set the CSV delimiter character.

    PropertyTypeDefaultDescription
    $delimiter string ',' CSV delimiter character
    $form_id int N/AThe form ID

    Sample code

    /**
     * Use semicolon delimiter for CSV.
     *
     * @param string $delimiter The delimiter.
     * @param int    $form_id   The form ID.
     * @return string The new delimiter.
     */
    function gravityexport_semicolon_delimiter( $delimiter, $form_id ) {
        return ';';
    }
    add_filter( 'gfexcel_renderer_csv_delimiter', 'gravityexport_semicolon_delimiter', 10, 2 );

    gfexcel_renderer_csv_enclosure

    Applies to: CSV (.csv) only

    Set the CSV enclosure character.

    PropertyTypeDefaultDescription
    $enclosure string '"' CSV enclosure character
    $form_id int N/AThe form ID

    gfexcel_renderer_csv_line_ending

    Applies to: CSV (.csv) only

    Set the CSV line ending character(s).

    PropertyTypeDefaultDescription
    $line_ending string "rn" CSV line ending
    $form_id int N/AThe form ID

    gfexcel_renderer_csv_use_bom

    Applies to: CSV (.csv) only

    Control whether to include BOM (Byte Order Mark) in CSV.

    PropertyTypeDefaultDescription
    $use_bom bool false Whether to include UTF-8 BOM
    $form_id int N/AThe form ID

    Sample code

    /**
     * Add UTF-8 BOM for Excel compatibility.
     *
     * @param bool $use_bom Whether to use BOM.
     * @param int  $form_id The form ID.
     * @return bool True to include BOM.
     */
    function gravityexport_enable_bom( $use_bom, $form_id ) {
        return true;
    }
    add_filter( 'gfexcel_renderer_csv_use_bom', 'gravityexport_enable_bom', 10, 2 );

    gfexcel_renderer_csv_include_separator_line

    Applies to: CSV (.csv) only

    Include a separator line at the top of CSV files.

    PropertyTypeDefaultDescription
    $include bool false Whether to include separator line
    $form_id int N/AThe form ID

    gfexcel_renderer_csv_output_encoding

    Applies to: CSV (.csv) only

    Set the CSV output encoding.

    PropertyTypeDefaultDescription
    $encoding string 'UTF-8' Output encoding
    $form_id int N/AThe form ID

    Advanced Filters #

    gfexcel_value_type

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Change the value object class used to render a specific field’s data.

    PropertyTypeDefaultDescription
    $type string Field-dependentValue class name (e.g., ‘StringValue’, ‘NumericValue’)
    $field_type string N/AThe field input type
    $form_id int N/AThe form ID
    $field_id int N/AThe field ID
    $gf_field GF_Field N/AThe field object
    $is_label bool false Whether this value object is for a label

    gfexcel_field_separated

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Control whether a field should be split into separate columns (applies to Name, Address, and similar multi-part fields).

    PropertyTypeDefaultDescription
    $separated bool Settings-dependentWhether to separate into multiple columns
    $field_type string N/AThe field input type (e.g., ‘name’, ‘address’)
    $form_id int N/AThe form ID
    $field_id int N/AThe field ID
    $field GF_Field N/AThe field object

    Sample code

    /**
     * Keep name field as single column.
     *
     * @param bool     $separated  Whether to separate.
     * @param string   $field_type The field input type.
     * @param int      $form_id    The form ID.
     * @param int      $field_id   The field ID.
     * @param GF_Field $field      The field object.
     * @return bool False to keep as single column.
     */
    function gravityexport_single_name_column( $separated, $field_type, $form_id, $field_id, $field ) {
        if ( 'name' === $field_type ) {
            return false;
        }
    
        return $separated;
    }
    add_filter( 'gfexcel_field_separated', 'gravityexport_single_name_column', 10, 5 );

    gfexcel_field_label

    Applies to: Excel (.xlsx), CSV (.csv), PDF (.pdf)

    Customize field labels (column headers) in the export.

    PropertyTypeDefaultDescription
    $label string Field labelThe column header label
    $field_type string N/AThe field input type
    $form_id int N/AThe form ID
    $field_id int N/AThe field ID
    $field GF_Field N/AThe field object

    Sample code

    /**
     * Add field ID to column headers.
     *
     * @param string   $label      The field label.
     * @param string   $field_type The field input type.
     * @param int      $form_id    The form ID.
     * @param int      $field_id   The field ID.
     * @param GF_Field $field      The field object.
     * @return string Modified label.
     */
    function gravityexport_add_id_to_label( $label, $field_type, $form_id, $field_id, $field ) {
        return sprintf( '%s (ID: %d)', $label, $field_id );
    }
    add_filter( 'gfexcel_field_label', 'gravityexport_add_id_to_label', 10, 5 );

    Actions #

    gfexcel_renderer_cell_properties

    Applies to: Excel (.xlsx), PDF (.pdf)

    Modify cell properties directly using PhpSpreadsheet API.

    PropertyTypeDescription
    $cell Cell PhpSpreadsheet Cell object
    $value BaseValue|mixed The cell value object or raw value
    $form_id int The form ID

    Sample code

    /**
     * Make header row bold with background color.
     *
     * @param Cell  $cell    The cell object.
     * @param mixed $value   The cell value.
     * @param int   $form_id The form ID.
     */
    function gravityexport_style_header_row( $cell, $value, $form_id ) {
        if ( 1 !== $cell->getRow() ) {
            return;
        }
    
        $cell->getStyle()->getFont()->setBold( true );
        $cell->getStyle()->getFill()
            ->setFillType( PhpOfficePhpSpreadsheetStyleFill::FILL_SOLID )
            ->getStartColor()->setRGB( 'CCCCCC' );
    }
    add_action( 'gfexcel_renderer_cell_properties', 'gravityexport_style_header_row', 10, 3 );
    Still stuck? How can we help?

    How can we help?

    "*" indicates required fields

    This field is for validation purposes and should be left unchanged.
    Replies will go to this email.
    How can we help?*
    My pre-sale question is related to...*
    My WordPress skills are....*
    My Gravity Forms skills are...*
    You will be shown articles from our documentation.
    Vous pouvez nous écrire dans votre langue maternelle si c’est plus facile pour vous—nous nous occuperons de la traduction!
    Puedes escribirnos en tu idioma nativo si te resulta más fácil; ¡nosotros nos encargamos de la traducción!
    Sie können uns in Ihrer Muttersprache schreiben, wenn das für Sie einfacher ist – wir kümmern uns um die Übersetzung!
    U kunt ons in uw moedertaal schrijven als dat gemakkelijker voor u is — wij zorgen voor de vertaling!
    Du kan skrive til oss på ditt morsmål hvis det er enklere for deg — vi tar oss av oversettelsen!
    Du kan skriva till oss på ditt modersmål om det är lättare för dig — vi tar hand om översättningen!
    Você pode nos escrever em seu idioma nativo se for mais fácil para você — nós cuidaremos da tradução!
    Puoi scriverci nella tua lingua madre se ti è più facile — penseremo noi alla traduzione!
    Please provide as much detail as you're able; this helps us provide you with faster support.
    Drop files here or
    Accepted file types: jpg, jpeg, gif, png, tiff, pdf, bmp, zip, json, csv, xls, xlsx, Max. file size: 256 MB.
      Stay informed?

      Was this page helpful?

      Table Of Contents
      • gfexcel_renderer_matrix
      • gfexcel_renderer_hide_row
      • gfexcel_renderer_columns_max_width
      • gfexcel_renderer_wrap_text
      • gfexcel_renderer_worksheet_title
      • gfexcel_renderer_disable_hyperlinks
      • gfexcel_output_rows
      • gfexcel_output_columns
      • gfexcel_output_search_criteria
      • gfexcel_output_sorting_options
      • gfexcel_field_checkbox_empty
      • gfexcel_field_date_format
      • gfexcel_combiner_glue
      • gfexcel_file_extension
      • gfexcel_file_extensions
      • CSV-Specific Filters
      • Advanced Filters
      • Actions
      GravityKit
      • How to Build It
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Privacy Policy
      • Terms of Service (“Terms”)
      About Us
      • GravityKit on Mastodon
      • GravityKit on Twitter
      • GravityKit Training Courses
      • GravityKit on Facebook
      • Join our Facebook Group
      • Facebook
      • Twitter
      Get notified of updates.

      We’re constantly improving GravityKit. Fill out your email below and we’ll notify you anytime major updates drop.

      GravityKit is a Gravity Forms Certified Developer.

      Copyright © 2026, Katz Web Services, Inc.

      GravityKit and GravityView are registered trademarks of Katz Web Services, Inc.