WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#33764 closed defect (bug) (invalid)

A permanent auto-draft?

Reported by: luciole135 Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: General Keywords:
Focuses: Cc:

Description

Hello
I noticed that WordPress creates auto-draft in the datatable wp_posts permanently:

  • even if you are not trying to write a new article.
  • even for an empty and newly created site.

And this since at least WordPress 3.9.

I have attached a screenshot which shows that its creation date is equal to zero. Exactly to 0000-00-00 00:00:00.

http://zupimages.net/viewer.php?id=15/36/l4ug.png

What is this problem?

I talk about this here: https://wordpress.org/support/topic/a-permanent-auto-draft?replies=1

Change History (3)

#1 @swissspidy
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Hey there.

Quoting the explanations from an old wp-hackers thread:

Auto-drafts exist because of the fact that multiple users can create new posts at the same time. If two people enter post-new at roughly the same moment, then have their first autosaves occur nearly simultaneously, then there is a race condition that can cause one of them to get back the wrong post ID, which will cause a post to be overwritten/lost when they then continue editing the post.

The auto-draft creates the post and gets the ID of the new post before the editing screen is displayed, thus preventing two simultaneous authors from accidentally having the same post ID in the data in their browser.

Furthermore:

Auto-drafts are automatically deleted after 7 days of going unused. They're self-cleaning, basically. No need to worry about them.

They also go away when the first auto-save occurs while writing a new post.

Via: http://wordpress.stackexchange.com/questions/44352/how-to-avoid-a-bunch-of-useless-auto-draft-id-entries-related-in-posts-table-an

Personally I've never seen an install where auto-drafts wouldn't get deleted after that period of time. Closing this as invalid as it isn't a bug or an enhancement.

#2 @luciole135
5 years ago

Thank you very much, I understand now.

#3 @swissspidy
5 years ago

#37146 was marked as a duplicate.

Note: See TracTickets for help on using tickets.