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, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • 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 between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

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

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

  • Ideal For

    • Nonprofits
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    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
  • Support
  • Pricing
  • 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, PDF, or Google Sheets, then share them with secure links or deliver them to cloud storage on a schedule.

    • 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 between sites, including forms, entries, settings, Views, feeds, and file uploads, and import forms from other form plugins.

    • GravityBoard

      GravityBoard

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

    • GravitySearch

      GravitySearch

      Search Gravity Forms entries across every form from one screen.

    View All Products

    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
    • Web Agencies
    • Education
    • Developers
    • Small Businesses
    • Startups
    Explore All Use Cases

    Case studies

    • Be There Local
    • Killer Shorts
    • West Fork Schools
    • Princeton University
    • BrightLeaf Giving
    • Jacksonville Port Authority
    • National Severe Storms Lab
    • Leadpal
    View All Case Studies

    How to build...

    • Client Portal
    • AI-Built Directory
    • Conference Website
    • WordPress CRM
    • Admin Dashboard
    • Inventory Management
    • Vendor Portal
    • Document Library
    View All Guides
  • Resources

    • Blog
    • Case studies
    • Newsletter
    • GravityKit vs competitors
    • Live Demos
    • Documentation
    • Developer docs
    • GravityKit Academy

    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
  • Support
  • Pricing
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
    • GravityRevisions
    • GravitySearch
    • GF Widget for Elementor
    • GF Dynamic Lookup
    • GF Entry Tags
    • GF Event Field
    • GravityExport Lite
    • GF Zero Spam
    • GravityMigrate

    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
    • Agency accounts
    • Contact
    • Docs Home
    • Gravity Forms Add-Ons

      • GravityView
      • GravityActions
      • GravityBoard
      • GravityCalendar
      • GravityCharts
      • GravityEdit
      • GravityExport
      • GravityImport
      • GravityMath
      • GravityRevisions
      • GravitySearch
      • GF Widget for Elementor
      • GF Dynamic Lookup
      • GF Entry Tags
      • GF Event Field
      • GravityExport Lite
      • GF Zero Spam
      • GravityMigrate
    • 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
      • Agency accounts
    • Contact

    GravityExport

    • Checkbox values for removed choices are missing from exports
    • Connecting Box to GravityExport
    • Export Gravity Forms entries to Google Sheets
    • 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: 31 minutes

    Updated on September 23, 2026

    These are the developer hooks available in GravityExport 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. For more hooks, see the GravityExport section of the GravityKit developer documentation.

    Most hooks use gf_apply_filters(), so they also run with the form ID added to the name (for example, gfexcel_renderer_matrix_{form_id}), which limits them to that form. A few hooks work differently. gfexcel_renderer_columns_max_width, gfexcel_renderer_disable_hyperlinks, gfexcel_file_extensions and the GravityExport Save hooks take no suffix. gfexcel_combiner_glue takes _{field_type} and _{field_type}_{field_id}. gfexcel_value_type, gfexcel_field_separated, gfexcel_field_label, gfexcel_field_value and gfexcel_field_disable take _{input_type}, _{input_type}_{form_id} and _{input_type}_{form_id}_{field_id}.

    Note: Some GravityExport Save exports skip hooks on this page. Google Sheets feeds skip gfexcel_output_rows, gfexcel_output_columns and the gfexcel_renderer_* hooks. Scheduled CSV exports of more than 500 entries, with Column Position set to At the top (normal), are written row by row. They skip gfexcel_output_rows, gfexcel_renderer_matrix and the BOM, line ending, separator line and output encoding CSV filters, and they pass the delimiter and enclosure filters only one argument.


    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

    Matrix Structure

    The matrix is a two-dimensional array where:

    • Row 0 (Header): Contains column header objects (GFExcel\Values\StringValue)
    • Row 1+ (Data): Contains entry data as value objects

    Each cell in the matrix is a value object that extends GFExcel\Values\BaseValue, or null when a field has no value for that entry. For example:

    • GFExcel\Values\StringValue: Text values
    • GFExcel\Values\NumericValue: Numeric values (Entry ID, User ID, etc.)
    • GFExcel\Values\BoolValue: True or false values
    • GFExcel\Values\CurrencyValue: Currency amounts (extends NumericValue)

    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

    GravityExport has a built-in setting for this: turn on Exclude empty columns under GravityKit > Settings > GravityExport. The code below does the same in GravityExport Lite, or when you need your own rules. It leaves out every column whose values are all 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.
     *
     * @return array The matrix with empty columns removed.
     */
    function gfexcel_remove_empty_columns( $matrix ) {
        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' );

    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 header row from the export.
     *
     * @param mixed[] $matrix The matrix containing all rows and columns.
     * @return mixed[] The matrix without its first row.
     */
    add_filter( 'gfexcel_renderer_matrix', function( $matrix ) {
        unset( $matrix[0] ); // Remove the first (header) row.
        return array_values( $matrix ); // Re-index the rows so they start at 0 again.
    } );

    gfexcel_renderer_hide_row #

    Applies to: Excel (.xlsx)

    Hide specific rows from the export based on custom logic. In Excel files the row is hidden, not deleted. CSV and PDF exports still include the row.

    PropertyTypeDefaultDescription
    $hide bool false Whether to hide the row
    $row array N/AThe row’s cells in column order. Each cell is a value object, or null when the field has no value.

    Sample code

    /**
     * Hide rows where field 1 (a single-input field) is empty.
     *
     * @param bool  $hide Whether to hide the row.
     * @param array $row  The row's cells: value objects, or null for an empty cell.
     * @return bool True to hide the row.
     */
    function gravityexport_hide_empty_field_rows( $hide, $row ) {
        foreach ( $row as $cell ) {
            if ( is_object( $cell ) && '1' === $cell->getFieldId() && '' === $cell->getValue() ) {
                return true;
            }
        }
    
        return $hide;
    }
    add_filter( 'gfexcel_renderer_hide_row', 'gravityexport_hide_empty_field_rows', 10, 2 );

    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

    Sample code

    /**
     * Disable text wrapping for all cells.
     *
     * @return bool False to disable text wrapping.
     */
    add_filter( 'gfexcel_renderer_wrap_text', '__return_false' );

    gfexcel_renderer_worksheet_title #

    Applies to: Excel (.xlsx)

    Customize the worksheet (tab) name in the Excel file. Excel allows at most 31 characters, so a longer title is cut off. This filter does not change the title of PDF exports.

    PropertyTypeDefaultDescription
    $title string Form titleWorksheet title, without the characters Excel does not allow. Cut to 31 characters after the filter runs.
    $form array N/AThe form object

    Sample code

    /**
     * Add the form ID to the worksheet title.
     *
     * @param string $title The worksheet title.
     * @param array  $form  The form object.
     * @return string Modified worksheet title (cut to 31 characters).
     */
    function gravityexport_custom_worksheet_title( $title, $form ) {
        return sprintf( 'Form %d - %s', $form['id'], $title );
    }
    add_filter( 'gfexcel_renderer_worksheet_title', 'gravityexport_custom_worksheet_title', 10, 2 );

    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/AThe entry rows. Each row lists its cells in column order: value objects, or null for an empty cell.
    $form_id int N/AThe form ID

    Sample code

    /**
     * Leave out entries whose field 1 contains "test".
     *
     * @param array $rows    The rows. Each row holds value objects (or null) in column order.
     * @param int   $form_id The form ID.
     * @return array Filtered rows.
     */
    function gravityexport_remove_test_entries( $rows, $form_id ) {
        return array_values( array_filter( $rows, function( $row ) {
            foreach ( $row as $cell ) {
                if ( is_object( $cell ) && '1' === $cell->getFieldId() && false !== stripos( $cell->getValue(), 'test' ) ) {
                    return false;
                }
            }
    
            return true;
        } ) );
    }
    add_filter( 'gfexcel_output_rows', 'gravityexport_remove_test_entries', 10, 2 );

    gfexcel_output_columns #

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

    Modify the column headers before they are combined with the rows. Removing a header here does not remove its cells from the rows, so every later column ends up under the wrong header. To leave a field out of the export, use gfexcel_field_disable as in the sample below. It receives $disabled and the GF_Field object.

    PropertyTypeDefaultDescription
    $columns array N/AThe column headers, as value objects in column order
    $form_id int N/AThe form ID

    Sample code

    /**
     * Leave the User IP and User Agent columns out of the export.
     *
     * @param bool     $disabled Whether the field is left out.
     * @param GF_Field $field    The field object.
     * @return bool True to leave the field out.
     */
    function gravityexport_disable_ip_columns( $disabled, $field ) {
        if ( in_array( (string) $field->id, [ 'ip', 'user_agent' ], true ) ) {
            return true;
        }
    
        return $disabled;
    }
    add_filter( 'gfexcel_field_disable', 'gravityexport_disable_ip_columns', 10, 2 );

    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)

    Set the value written for a checkbox field when none of its choices is checked. It does not run when at least one choice is checked. It is also available as gfexcel_field_checkbox_empty_{form_id}_{field_id}.

    PropertyTypeDefaultDescription
    $empty_value string '' Value to write when no choice is checked. An empty string leaves the cell empty.
    $entry array N/AThe entry object
    $field GF_Field N/AThe checkbox field object

    Sample code

    /**
     * Write "No" when no choice of a checkbox field is checked.
     *
     * @param string   $empty_value The value to write. Default ''.
     * @param array    $entry       The entry object.
     * @param GF_Field $field       The checkbox field object.
     * @return string The new value.
     */
    function gravityexport_checkbox_empty_no( $empty_value, $entry, $field ) {
        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)

    Change the date format used for Date fields in the export. The value is a Gravity Forms date format key, not a PHP date format string. A PHP format such as Y-m-d is not recognized and falls back to month/day/year. It is also available as gfexcel_field_date_format_{form_id}_{field_id}.

    PropertyTypeDefaultDescription
    $format string Date Format setting of the fieldGravity Forms date format key: mdy, dmy, dmy_dash, dmy_dot, ymd_slash, ymd_dash or ymd_dot

    Sample code

    /**
     * Write all Date fields as year-month-day, for example 2026-09-23.
     *
     * @param string $format The Gravity Forms date format key.
     * @return string The new date format key.
     */
    function gravityexport_ymd_date_format( $format ) {
        return 'ymd_dash';
    }
    add_filter( 'gfexcel_field_date_format', 'gravityexport_ymd_date_format' );

    gfexcel_combiner_glue #

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

    Set the separator placed between values when a field has several values for one entry and they share one cell, for example a Checkbox field with more than one choice checked. Checkbox fields use ', ' and List fields use a line break, set through gfexcel_combiner_glue_checkbox and gfexcel_combiner_glue_list at priority 10. To change those, hook the field type’s filter at a priority above 10, as in the sample below.

    PropertyTypeDefaultDescription
    $glue string "\n---\n" Separator placed between the values
    $value BaseValue N/AThe value that follows the separator

    Sample code

    /**
     * Separate checked checkbox choices with a semicolon.
     *
     * Priority 20 runs after GravityExport sets ', ' on this filter at priority 10.
     *
     * @param string $glue The separator.
     * @return string The new separator.
     */
    function gravityexport_checkbox_glue( $glue ) {
        return '; ';
    }
    add_filter( 'gfexcel_combiner_glue_checkbox', 'gravityexport_checkbox_glue', 20 );

    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. Not passed by every export path.
     * @return string The new delimiter.
     */
    function gravityexport_semicolon_delimiter( $delimiter, $form_id = 0 ) {
        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 PHP_EOL 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 '' Output encoding. The default, an empty string, writes the text without converting it.
    $form_id int N/AThe form ID

    Advanced Filters #

    gfexcel_value_type

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

    Change the value type of a field’s cells: 'string', 'numeric', 'bool' or 'currency'. The type selects the value object class, for example GFExcel\Values\NumericValue for 'numeric'. An unknown type falls back to 'string', and column headers are always strings.

    PropertyTypeDefaultDescription
    $type string Field-dependent'string', 'numeric', 'bool' or 'currency'
    $gf_field GF_Field N/AThe field object
    $is_label bool false Whether the value is a column header

    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 Multiple Columns settingWhether to split the field into one column per input
    $field GF_Field N/AThe field object

    Sample code

    /**
     * Keep Name fields in a single column.
     *
     * @return bool False to keep the field in one column.
     */
    add_filter( 'gfexcel_field_separated_name', '__return_false' );

    gfexcel_field_label

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

    Customize field labels (column headers) in the export. For a field split into several columns, it runs once per column with that input’s label.

    PropertyTypeDefaultDescription
    $label string Field labelThe column header label
    $field GF_Field N/AThe field object

    Sample code

    /**
     * Add the field ID to column headers.
     *
     * @param string   $label The column header label.
     * @param GF_Field $field The field object.
     * @return string Modified label.
     */
    function gravityexport_add_id_to_label( $label, $field ) {
        return sprintf( '%s (ID: %s)', $label, $field->id );
    }
    add_filter( 'gfexcel_field_label', 'gravityexport_add_id_to_label', 10, 2 );

    gfexcel_field_value

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

    Change a field’s value before it is written to the export. It runs for most form fields, but not for entry meta columns such as Entry ID or Entry Date, which use gfexcel_meta_value instead. To target one field, add the input type, form ID and field ID to the name: gfexcel_field_value_{input_type}_{form_id}_{field_id}.

    PropertyTypeDefaultDescription
    $value mixed Exported valueThe value to write
    $entry array N/AThe entry object
    $field GF_Field N/AThe field object
    $context array [] Reserved for extra context. Currently always empty.

    Sample code

    /**
     * Write the values of field 3 (a Single Line Text field) on form 5 in uppercase.
     *
     * @param mixed $value The field value.
     * @return mixed The new value.
     */
    function gravityexport_uppercase_field_value( $value ) {
        return is_string( $value ) ? strtoupper( $value ) : $value;
    }
    add_filter( 'gfexcel_field_value_text_5_3', 'gravityexport_uppercase_field_value' );

    Actions #

    gfexcel_renderer_cell_properties

    Applies to: Excel (.xlsx). Cell styles set here do not appear in PDF exports.

    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( 'solid' ) // Fill::FILL_SOLID
            ->getStartColor()->setRGB( 'CCCCCC' );
    }
    add_action( 'gfexcel_renderer_cell_properties', 'gravityexport_style_header_row', 10, 3 );

    GravityExport Save hooks #

    The hooks below apply to Save feeds rather than to the file renderers above. The first three were added in GravityExport 1.15.0 (Google Sheets export, connection monitoring, and copying feeds to other forms). The five that follow cover scheduled, manual and entry-triggered export runs; each entry notes the version it was added in.

    gk/gravityexport/sheets/rows-page

    Applies to: Google Sheets export (filter)

    Modify each page of rows before it is written to Google Sheets. The filter fires once per page, so a listener sees part of the export at a time and should not assume it is looking at the whole sheet or at the header row.

    PropertyTypeDescription
    $rowsarray[]The page’s rows. Each cell is a string, or null when the field has no value.
    $form_idintThe form being exported
    $offsetintNumber of entries skipped before this page

    Sample code

    /**
     * Write "N/A" instead of an empty cell for form 12.
     *
     * @param array[] $rows    The page's rows.
     * @param int     $form_id The form ID.
     * @param int     $offset  Entries skipped before this page.
     * @return array[] Modified rows.
     */
    function gravityexport_sheets_fill_blanks( $rows, $form_id, $offset ) {
        if ( 12 !== (int) $form_id ) {
            return $rows;
        }
    
        foreach ( $rows as &$row ) {
            foreach ( $row as &$cell ) {
                if ( null === $cell || '' === $cell ) {
                    $cell = 'N/A';
                }
            }
        }
    
        return $rows;
    }
    add_filter( 'gk/gravityexport/sheets/rows-page', 'gravityexport_sheets_fill_blanks', 10, 3 );

    gk/gravityexport/save/monitored-connection/failed

    Applies to: Cloud storage connections with Monitor connections enabled (action)

    Fires when a monitored cloud storage connection (Google Sheets, Dropbox, or Box) is found to be offline. Use it to notify someone or log the outage. It fires on every check that finds the connection offline, about every 12 hours, not only when the connection first goes offline. Only connections that an active Save feed uses are checked.

    PropertyTypeDescription
    $providerMonitorableConnectionThe offline connection. getId() returns its slug and getTitle() its display name

    Sample code

    /**
     * Email the site admin when a cloud connection goes offline.
     *
     * @param MonitorableConnection $provider The offline connection.
     */
    function gravityexport_notify_connection_offline( $provider ) {
        wp_mail(
            get_option( 'admin_email' ),
            sprintf( 'GravityExport: %s connection is offline', $provider->getTitle() ),
            'Reconnect it under GravityKit > Settings > GravityExport before scheduled exports fail.'
        );
    }
    add_action( 'gk/gravityexport/save/monitored-connection/failed', 'gravityexport_notify_connection_offline' );

    gk/gravityexport/save/feed-copy/unknown-key

    Applies to: The Copy to Other Forms bulk action on Save feeds (filter)

    Decide whether a feed meta key the copier does not recognize (for example, one added by your own code) is copied to the target form or dropped. Return 'copy' or 'drop'. The default is 'copy'.

    PropertyTypeDescription
    $actionstringThe action to take. Default 'copy'; accepts 'copy' or 'drop'
    $keystringThe unrecognized meta key
    $valuemixedThe value stored under the key
    $source_metaarrayThe full source feed meta
    $target_form_idintThe form the feed is being copied to

    Sample code

    /**
     * Don't carry a per-form note over when a feed is copied.
     *
     * @param string $action         'copy' or 'drop'.
     * @param string $key            The unrecognized meta key.
     * @param mixed  $value          Its value.
     * @param array  $source_meta    The source feed meta.
     * @param int    $target_form_id The target form ID.
     * @return string 'copy' or 'drop'.
     */
    function gravityexport_drop_note_on_copy( $action, $key, $value, $source_meta, $target_form_id ) {
        if ( 'my_plugin_form_note' === $key ) {
            return 'drop';
        }
    
        return $action;
    }
    add_filter( 'gk/gravityexport/save/feed-copy/unknown-key', 'gravityexport_drop_note_on_copy', 10, 5 );

    gk/gravityexport/save/cron/completed

    Applies to: Scheduled export runs (action, since 1.7.0)

    Fires after a scheduled export finishes successfully, whether it ran in one pass or in chunks. Only scheduled runs fire it. Exports triggered by a new entry, a webhook, or Export Now do not.

    PropertyTypeDescription
    $feedarrayThe Gravity Forms feed array
    $row_countintThe number of rows exported

    Sample code

    /**
     * Log every successful scheduled export.
     *
     * @param array $feed      The Gravity Forms feed array.
     * @param int   $row_count The number of rows exported.
     */
    function gravityexport_log_scheduled_export( $feed, $row_count ) {
        error_log( sprintf(
            'GravityExport: feed %d on form %d exported %d rows.',
            $feed['id'],
            $feed['form_id'],
            $row_count
        ) );
    }
    add_action( 'gk/gravityexport/save/cron/completed', 'gravityexport_log_scheduled_export', 10, 2 );

    gk/gravityexport/save/cron/failed

    Applies to: Scheduled export runs (action, since 1.7.0)

    Fires after a scheduled export fails. Use it to alert someone or log the error. GravityExport catches anything your listener throws so it cannot hide the original failure, and the feed’s Activity Log and Failure Alerts still record the run.

    PropertyTypeDescription
    $feedarrayThe Gravity Forms feed array
    $e\ThrowableThe error or exception that caused the failure

    Sample code

    /**
     * Email the site admin when a scheduled export fails.
     *
     * @param array      $feed The Gravity Forms feed array.
     * @param \Throwable $e    The error or exception that caused the failure.
     */
    function gravityexport_notify_export_failed( $feed, $e ) {
        wp_mail(
            get_option( 'admin_email' ),
            sprintf( 'GravityExport: scheduled export failed for feed %d', $feed['id'] ),
            $e->getMessage()
        );
    }
    add_action( 'gk/gravityexport/save/cron/failed', 'gravityexport_notify_export_failed', 10, 2 );

    gk/gravityexport/save/exported/manual

    Applies to: Runs started with Export Now on the feed list, or through the save-feed action below (action, since 1.1.6)

    Fires after a manually triggered run finishes without an error. It also fires when the feed is inactive and nothing was exported. It does not fire for scheduled, webhook, or entry-triggered runs.

    PropertyTypeDescription
    $feedarrayThe Gravity Forms feed array

    Sample code

    /**
     * Log manual export runs.
     *
     * @param array $feed The Gravity Forms feed array.
     */
    function gravityexport_log_manual_export( $feed ) {
        error_log( sprintf( 'GravityExport: feed %d was exported manually.', $feed['id'] ) );
    }
    add_action( 'gk/gravityexport/save/exported/manual', 'gravityexport_log_manual_export' );

    gk/gravityexport/save/exported/entry

    Applies to: Save feeds with the Automatic trigger (action, since 1.1.6)

    Fires after a feed with the Automatic trigger exports an entry. When Export on Update is turned on, it also fires after an entry is edited. Scheduled, webhook, and manual runs do not fire it.

    PropertyTypeDescription
    $entryarrayThe entry that triggered the export
    $formarrayThe form object
    $feedarrayThe Gravity Forms feed array
    $storage_typeStorageTypeInterfaceThe destination. getTitle() returns its name

    Sample code

    /**
     * Log every entry an Automatic Save feed exports.
     *
     * @param array                $entry        The entry object.
     * @param array                $form         The form object.
     * @param array                $feed         The Gravity Forms feed array.
     * @param StorageTypeInterface $storage_type The destination.
     */
    function gravityexport_log_entry_export( $entry, $form, $feed, $storage_type ) {
        error_log( sprintf(
            'GravityExport: feed %d exported entry %d to %s.',
            $feed['id'],
            $entry['id'],
            $storage_type->getTitle()
        ) );
    }
    add_action( 'gk/gravityexport/save/exported/entry', 'gravityexport_log_entry_export', 10, 4 );

    gk/gravityexport/save/action/save-feed

    Applies to: Your own code (an action you call, since 1.4.0)

    Call this action to run a Save feed on demand, for example from a WP-CLI command, a custom REST endpoint, or a WP Crontrol event. The feed must be an All Entries feed with a Scheduled or Webhook trigger; feeds set to Automatic are ignored. When the run finishes without an error, gk/gravityexport/save/exported/manual fires. The feed must also be active: an inactive feed exports nothing, but gk/gravityexport/save/exported/manual still fires.

    PropertyTypeDescription
    $feed_idintThe ID of the Save feed to run

    Sample code

    /**
     * Run Save feed 42 right now, for example from a custom WP-CLI command.
     */
    do_action( 'gk/gravityexport/save/action/save-feed', 42 );
    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.
      Get better at Gravity Forms every Friday

      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
      • GravityExport Save hooks
      GravityKit
      • How to Build It
      • GravityKit vs competitors
      • Pricing
      • Products
      • Our Team
      • Our Values
      • Work With Us
      • Partner Directory
      • Coupons
      Support
      • Support
      • Contact
      • Documentation
      • Scope of Support
      • Brand Guidelines
      • Brand Kit
      • Privacy Policy
      • Terms of Service (“Terms”)
      I am a...
      • Nonprofit
      • Web agency
      • Small business owner
      • Web developer
      • Educational institution
      • WordPress freelancer
      • Startup founder
      • One-person agency
      Get notified of updates.

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

      See past editions
      • Facebook
      • Twitter
      • Mastodon
      GravityKit is a Gravity Forms Certified Developer.

      Copyright © 2026, Katz Web Services, Inc.

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