diff --git a/src/wp-admin/includes/privacy-tools.php b/src/wp-admin/includes/privacy-tools.php
index 7e2badcb4e..5b7a04a8b3 100644
--- a/src/wp-admin/includes/privacy-tools.php
+++ b/src/wp-admin/includes/privacy-tools.php
@@ -401,17 +401,29 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
 	 */
 	$error            = false;
 	$archive_url      = get_post_meta( $request_id, '_export_file_url', true );
+	$archive_filename = get_post_meta( $request_id, '_export_file_name', true );
 	$archive_pathname = get_post_meta( $request_id, '_export_file_path', true );
 
-	if ( empty( $archive_pathname ) || empty( $archive_url ) ) {
+	if ( empty( $archive_filename ) && ! empty( $archive_pathname ) ) {
+		$archive_filename = basename( $archive_pathname );
+
+		update_post_meta( $request_id, '_export_file_name', wp_normalize_path( $archive_filename ) );
+		delete_post_meta( $request_id, '_export_file_path' );
+
+		if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) {
+			wp_delete_file( $archive_pathname );
+		}
+	
+	} elseif ( empty( $archive_pathname ) || empty( $archive_url ) ) {
 		$archive_filename = $file_basename . '.zip';
-		$archive_pathname = $exports_dir . $archive_filename;
 		$archive_url      = $exports_url . $archive_filename;
 
 		update_post_meta( $request_id, '_export_file_url', $archive_url );
-		update_post_meta( $request_id, '_export_file_path', wp_normalize_path( $archive_pathname ) );
+		update_post_meta( $request_id, '_export_file_name', wp_normalize_path( $archive_filename ) );
 	}
 
+	$archive_pathname = $exports_dir . $archive_filename;
+
 	if ( ! empty( $archive_pathname ) && file_exists( $archive_pathname ) ) {
 		wp_delete_file( $archive_pathname );
 	}
