Quick collection of code snippets to help customize post dates to reflect most-recent-update information. I use this technique here at WP-Mix, DigWP, and elsewhere. Using the most recent date as the post date can boost the SEO value of your site.

..you are limiting the post date to the day that the post was originally published. This is fine for many situations, but if you ever update your WP posts with newer information, it can be an SEO benefit to display the date that reflects the most recent update. You know, so if you publish a post in 2012 and then update it in 2018, the post date will show the most current date instead of the older date. Whether or not this strategy is a good fit for your site is entirely up to you; I’m just here to show you how it’s done.

Displaying Update Dates!

So to display the most recent post date that is available (either the original publish date or the update date), you can use something like this in your theme template (in the WP Loop):

What’s going on here? Well basically we replaced the the_time() tag the_modified_time(). That’s the moral of the story, right there. When using this code, your posts will display the most current date available.

This snippet is used here at WP-Mix. It does the same thing as the previous example: displays output conditionally, based on the post date. To see it in action, browse through some posts here on the site :)