PDF for GravityView Hooks – gfpdf_gv_bulk_export_filename
Description
Use this filter to change the name of the ZIP file the Download PDFs bulk action creates. By default it's named after the View and the date, such as Staff-Directory-documents-2026-09-21.zip.
Return the name without an extension. .zip is added for you.
This filter doesn't rename the PDFs inside the ZIP. Each PDF uses its own name (see gfpdf_gv_pdf_filename) with the entry ID added to the end, so two entries can't overwrite each other. For a Multiple Forms joined entry, each entry ID is added, separated by hyphens.
See Download PDFs. Related hooks: gfpdf_gv_bulk_export_capability and gfpdf_gv_bulk_export_ttl.
Version
This hook was introduced in PDF for GravityView 2.0.
Arguments
The following arguments are passed to functions that use this hook:
$filename | string
- The ZIP file's name, without the
.zipextension. - The default value is
{View title}-documents-{Y-m-d}, ordocuments-{Y-m-d}if the View has no title. The View title is passed throughsanitize_file_name(), so spaces become hyphens. - The date uses your site's timezone.
$view | \GV\View
- The View the PDFs were exported from.
Usage
Add the time to the name, so exports from the same day have different names:
add_filter( 'gfpdf_gv_bulk_export_filename', function( $filename, $view ) {
return sanitize_file_name( get_the_title( $view->ID ) ) . '-' . wp_date( 'Y-m-d-His' );
}, 10, 2 );
Source Code
This filter is located in src/GravityView/BulkExport.php of the PDF for GravityView extension.