Expire Personal Data Export Downloads After 24 Hours
Shortens how long the download link and ZIP file of a personal data export stay available, from WordPress's default of three days to one day.
Opens WPIDE on
Code
// Hours an export file remains downloadable.
$wpide_export_hours = 24;
add_filter( 'wp_privacy_export_expiration', function () use ( $wpide_export_hours ) {
return (int) $wpide_export_hours * HOUR_IN_SECONDS;
} );
Notes
Change the value in hours to fit how quickly people usually download their exports.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.