# Remind Administrators to Publish a Privacy Policy

> Shows a notice on the dashboard while no published privacy policy page is selected in Settings > Privacy, with a link to set one up.

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

## Code

```php
add_action( 'admin_notices', function () {
    $screen = get_current_screen();

    if ( ! $screen || 'dashboard' !== $screen->id || ! current_user_can( 'manage_privacy_options' ) ) {
        return;
    }

    $page_id = (int) get_option( 'wp_page_for_privacy_policy' );

    if ( $page_id && 'publish' === get_post_status( $page_id ) ) {
        return;
    }

    printf(
        '<div class="notice notice-warning"><p>%s <a href="%s">%s</a></p></div>',
        esc_html( 'Your site has no published privacy policy page.' ),
        esc_url( admin_url( 'options-privacy.php' ) ),
        esc_html( 'Set one up now' )
    );
} );
```

## Notes

The notice disappears as soon as a published page is selected.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remind Administrators to Publish a Privacy Policy" 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/
