Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#46933 closed enhancement (wontfix)

Re-publishing a drafted post does not update post_date in database

Reported by: subrataemfluence Owned by:
Milestone: Priority: normal
Severity: trivial Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:


I am not sure if this is a bug really! But when I re-published a drafted post I have seen the modified_date changes but post_date does not.

How I tested:

  1. Created a post (Post-1) and saved as Draft.
  2. Edited it and Published. Both post_date and post_modified get updated.
  3. Created a new post (Post-2) and Published it. Both post_date and post_modified dates are same, which is fine.
  4. Edited and switched it back to Draft mode. post_modified got updated.
  5. Then again edited to Publish it. Only post_modified column got updated.

In short, if I publish a post which was originally saved as draft, both date columns are getting updated, but the behavior is different if I re-publish a post which was originally Published and then switched back to Draft mode.

Has this been done in purpose so that the once a post is published its post_date will not update (unless I change it via Quick Edit)?

The question is when a post can be re-published, why not the recent publish date gets saved in the database.

Since I am not sure if this is a bug, I am setting the type as Enhancement.

Change History (2)

#1 @Mista-Flo
2 years ago

  • Resolution set to wontfix
  • Severity changed from normal to trivial
  • Status changed from new to closed

For me it's a normal behaviour.

The post_date is the original published post date, and you can rely on the post_modifed date to know if there is a more recent version of the current post. You find a lot of tutorials to allow you to display the last modified post date in post page (frontend) instead of just the post date for example. https://www.wpbeginner.com/wp-tutorials/display-the-last-updated-date-of-your-posts-in-wordpress/

#2 @desrosj
2 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.