I often update my older posts with additional information to keep them fresh and accurate. I include both the “Published” date and “Last Updated” date at the top of posts so users know the history and accuracy of the article.
The WordPress function
get_the_modified_date() can be used to list this date, but there’s one small problem. It changes for any update, no matter how minor.
If I’m fixing a typo or adjusting the categories on the post, I don’t want the modified date to change. So I built a plugin.
Limit Modified Date
This plugin works with both the Gutenberg block editor and classic editor.
This plugin adds a checkbox to the Publish box that lets you prevent the modified date from updating. Leave this checked while you’re making your minor content changes.
When it’s time for a notable content update, uncheck the box and save the post.
Whether you’re using the Classic Editor or the new Gutenberg block editor, this plugin will work great for you.
Check all posts
If you would like to automatically check this box on all of your current posts, you can run this command in wp cli:
for id in $(wp post list --post_type=post --format=ids); do wp post meta update $id limit_modified_date 1; done
Thanks @JiveDig for the tip!