At times, some users may experience issues when attempting to export entries. These issues are typically caused by theme/plugin conflicts or settings defined by the web host. In this article, we will provide a few possible solutions to this problem.
Test for a conflict
Entry exports use Ajax requests to get the fields for the selected form and then export the entries for the selected fields in batches. If there are any JavaScript errors present on the page due to a conflicting theme or plugin that can prevent the export from functioning correctly. You’ll want to perform a full theme and plugin conflict test.
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.
Check permissions and ownership
Gravity Forms will ask WordPress to use /wp-content/uploads/gravity_forms/export/ folder to generate your export file. If permissions or ownership of this folder is not correctly set to allow WordPress to write files into it, the export will fail. Check the Troubleshooting and fixing “Upload folder is not writable” Errors doc page for more details.
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