Separating publish date and last modified

Am I correct in understanding that the publish date and the modified date are actually the same thing under the covers in WP?

We have a need to show “this article was last updated on”, which could be 2018 December. But the edit to put this date in our content could be done today, in April 2022. If we change the official modified date to be shown to the world (2018), by changing the publication date in WP, it doesn’t work as it always updates internally the modified date today and the sorting order even by “publish date” seems to reflect the modification today instead of the 2018 days I put in that article.

Am I doing something wrongly? How can we put in a custom publication date in the last while still retaining that this modification was done today?

I’ve tried using “modified” and “publish_date” in the WP Query and the results are confusing.

Topic date-time Wordpress

Category Web


The publish date is either when the post is originally published, or the date that you choose to set it as published in the Editor, so that is the part you can manually control. The modified date is whenever an update has most recently occurred, such as when the Update button is pressed in the Editor.

You might end up wanting to add a custom field to hold a "public date." The downside there is it would be stored in postmeta, making your queries less performant. Another alternative would be adding custom code that adds a date control in the Editor and forcibly sets the modified date to whatever you are choosing manually.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.