# Fact-Check Reminder When Editing Old Posts

> Shows a notice in the block editor when someone opens a post published more than two years ago, reminding them to check facts, links and screenshots while they are there.

- Type: PHP
- Runs: Admin only
- Category: [Content](https://wpide.com/library/category/content/)
- Tags: block-editor, notices, content-audit
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/content-old-post-editor-notice/

## Code

```php
// Age in years that triggers the reminder.
$wpide_old_post_years = 2;

add_action( 'enqueue_block_editor_assets', function () use ( $wpide_old_post_years ) {
    $post = get_post();
    if ( ! $post || 'publish' !== $post->post_status || get_post_time( 'U', true, $post ) > strtotime( "-{$wpide_old_post_years} years" ) ) {
        return;
    }

    $message = sprintf( 'This post was published %s ago. Please check that facts, prices, links and screenshots are still correct.', human_time_diff( get_post_time( 'U', true, $post ) ) );

    wp_add_inline_script(
        'wp-notices',
        sprintf( 'wp.domReady(function(){wp.data.dispatch("core/notices").createWarningNotice(%s,{id:"wpide-old-post",isDismissible:true});});', wp_json_encode( $message ) ),
        'after'
    );
    wp_enqueue_script( 'wp-notices' );
    wp_enqueue_script( 'wp-dom-ready' );
} );
```

## Notes

Change $wpide_old_post_years; the notice can be dismissed for the session.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Fact-Check Reminder When Editing Old Posts" 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/
