#46933 closed enhancement (wontfix)
Re-publishing a drafted post does not update post_date in database
| Reported by: | subrataemfluence | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | |
| Severity: | trivial | Keywords: | |
| Cc: | Focuses: |
Description
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:
- Created a post (Post-1) and saved as
Draft. - Edited it and
Published. Bothpost_dateandpost_modifiedget updated. - Created a new post (Post-2) and
Publishedit. Bothpost_dateandpost_modifieddates are same, which is fine. - Edited and switched it back to
Draftmode.post_modifiedgot updated. - Then again edited to
Publishit. Onlypost_modifiedcolumn 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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/