# 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.

- Type: PHP
- Runs: Run everywhere
- Category: [Privacy & Cookies](https://wpide.com/library/category/privacy/)
- Tags: gdpr, export, retention
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/privacy-export-link-expiry/

## Code

```php
// 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 use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Expire Personal Data Export Downloads After 24 Hours" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
