# Warn About Privacy Requests Close to the 30-Day Deadline

> Shows a dashboard notice to administrators when a personal data request has been waiting for more than 25 days, since GDPR expects an answer within one month.

- Type: PHP
- Runs: Admin only
- Category: [Privacy & Cookies](https://wpide.com/library/category/privacy/)
- Tags: gdpr, admin-notice, deadlines
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/privacy-request-deadline-notice/

## Code

```php
// Warn when a request is older than this many days.
$wpide_request_warn_days = 25;

add_action( 'admin_notices', function () use ( $wpide_request_warn_days ) {
    global $wpdb;

    if ( ! current_user_can( 'manage_options' ) ) {
        return;
    }

    $late = get_transient( 'wpide_late_privacy_requests' );

    if ( false === $late ) {
        $late = (int) $wpdb->get_var( $wpdb->prepare(
            "SELECT COUNT(*) FROM {$wpdb->posts} WHERE post_type = 'user_request' AND post_status IN ('request-pending','request-confirmed') AND post_date_gmt < %s",
            gmdate( 'Y-m-d H:i:s', time() - $wpide_request_warn_days * DAY_IN_SECONDS )
        ) );
        set_transient( 'wpide_late_privacy_requests', $late, HOUR_IN_SECONDS );
    }

    if ( $late ) {
        printf(
            '<div class="notice notice-error"><p>%s <a href="%s">Export requests</a> | <a href="%s">Erasure requests</a></p></div>',
            esc_html( sprintf( '%d personal data request(s) have been open for more than %d days.', $late, $wpide_request_warn_days ) ),
            esc_url( admin_url( 'export-personal-data.php' ) ),
            esc_url( admin_url( 'erase-personal-data.php' ) )
        );
    }
} );
```

## Notes

Change $wpide_request_warn_days to warn earlier; the check is cached for an hour.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Warn About Privacy Requests Close to the 30-Day Deadline" 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/
