Post Date: Smarter Modified

Show whichever is newer on the Post Date block: the published or modified date.

Lauren Gray Avatar

Post Date: Smarter Modified lets the Post Date block show whichever date is newer: the published date, or the modified date if the post has been updated since. One block, always the most recent date.

Before you start

  • WordPress 5.8.3 or later
  • PHP 5.6 or later
  • The block editor. The option is added to the core Post Date block.

Install

  1. In your WordPress dashboard, go to Plugins → Add New Plugin.
  2. Click Upload Plugin.
  3. Choose the plugin zip file.
  4. Click Install Now.
  5. Click Activate.

There’s no settings page. You turn it on per block.

How to use

Show the most recent date

  1. Open a post, page or template in the editor and select a Post Date block (or add one).
  2. In the block settings sidebar, open the Post date settings panel.
  3. Turn on Display recent date.
  4. Save.

The block now shows the modified date when it’s newer than the published date, and the published date otherwise. The sidebar shows a tip: “This post date block is locked to display the most recent date.”

Ignore quick fixes with minimum days

Fixed a typo the day after publishing? You probably don’t want that to read as an update. Minimum days makes the modified date show only once enough time has passed since publishing.

  1. With Display recent date on, turn on Use minimum days.
  2. Set Minimum days to the number of days you want.
  3. Save.

The modified date shows only when it’s newer than the published date by at least that many full days. Otherwise, the published date shows.

Block options

These are in the Post date settings panel on the Post Date block.

  • Display recent date: “Display the most recent date of the post.” Default: off.
  • Use minimum days: only appears when Display recent date is on. Requires a minimum gap before the modified date shows. Default: off.
  • Minimum days: only appears when Use minimum days is on. The number of days the modified date must be past the published date. Default: 1.

Developer reference

Coming soon: the hooks, filters and functions you can use with this plugin from your theme or a code snippet.

FAQs

Does it change my post’s dates?

No. It only changes which date the Post Date block displays. The stored published and modified dates stay the same.

Can I add “Updated on” before the date?

Not with this plugin alone. Post Date Labels adds separate labels for published and modified dates, and it reads this plugin’s setting to pick the right one.