WP Post Date Refresh is a lightweight WordPress plugin that adds a simple date refresh button to the post and page editor.
It lets editors set the publish date and modified date to the current WordPress site time, or to the current site time minus a chosen number of hours.
- Works with posts and pages.
- Adds a small editor meta box.
- Supports Classic Editor.
- Supports the Gutenberg/block editor meta box area.
- Updates
post_date,post_date_gmt,post_modified, andpost_modified_gmt. - Uses WordPress site timezone functions.
- Uses AJAX, nonce verification, and per-post edit capability checks.
- No settings page and no external libraries.
- WordPress 6.x or newer.
- PHP 7.4 or newer.
- Download or clone this repository.
- Copy the
wp-post-date-refreshfolder intowp-content/plugins/. - In WordPress admin, go to Plugins.
- Activate WP Post Date Refresh.
- Open any post or page in the WordPress editor.
- Find the Quick Date Refresh meta box.
- Enter an Hours offset:
- Use
0to set the date to the current WordPress site time. - Use a positive number, such as
3, to set the date to now minus 3 hours.
- Use
- Click Set date.
After a successful update, the plugin shows: Date updated successfully.
The plugin only runs in the WordPress admin area. Date updates require:
- A valid WordPress AJAX nonce.
- A logged-in user.
- Permission to edit the current post or page.
The hours offset input is sanitized, validated, and limited to non-negative whole numbers.
MIT License. Free to use, copy, modify, and distribute.