bookmark_borderResolving Issues with Gravity Forms Entry Exports

At times, some users may experience issues when attempting to export a large number of entries. This is typically caused by settings defined by the web host. In this article, we will provide a few possible solutions to this problem.

Increase available PHP memory

Many times, the issue is caused by the maximum memory available to PHP scripts on your web hosts. With some hosts, you may be able to increase this on your own. While this can vary based on your specific web hosts, it usually involves editing a php.ini file as well as your wp-config.php file.

Increasing Your PHP Memory Limits

Increase the PHP max execution time

In addition to running out of available memory caused by large amounts of data being exported, it’s also possible that the export takes longer than allowed by PHP. When this occurs, the process stops running and the export will fail. One of the following may solve the problem for you.

Increasing Your PHP Max Execution Time

Make multiple smaller exports

Sometimes, the best solutions is to just export less data. The more data being exported, the more time and resources it is going to take to be able to process it. Selecting multiple smaller date ranges will allow you to export the same amount of data, but in smaller chunks at a time.

For more information on selecting date ranges in your entry exports, review our article on exporting form entries.

The sanitize_file_name filter

In some cases usage of the WordPress sanitize_file_name filter in the theme or another plugin can cause an empty .csv file download. This usually happens when the filter is using the PHP uniqid() function to return a unique filename, this can result in the name of the temporary .csv file not matching the name the downloader is looking for.

You can prevent the filter overriding the csv export filename by including something like the following at the start of the function hooked to the filter.

function your_function_name( $filename ) {
    if ( strpos( $filename, 'export-' ) !== false ) {
        return $filename;
    // override the filename