Make WordPress Core

Opened 8 years ago

Closed 4 years ago

#37366 closed defect (bug) (duplicate)

Restoring a scheduled post can cause it to be published

Reported by: danielbachhuber's profile danielbachhuber Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: needs-patch dev-feedback
Focuses: Cc:


If you restore a scheduled post, the post will be published if the scheduled date has already passed.

As a user, I'd expect a scheduled post to remain a draft when restored from the trash.

Steps to reproduce:

  1. Create a new post.
  2. Schedule the post to be published two minutes in the future.
  3. Trash the post.
  4. Wait three minutes.
  5. Restore the post from the trash.
  6. Look at the post to see that it's been published.

There are a few existing related tickets #23022, #19907, #22350, #18362 that haven't seen much movement. However, I think this particular issue is more egregious than the others because the user accidentally publishes content they didn't mean to publish. On higher profile sites, particularly where there are distribution mechanisms hooked into the publishing process, this bug can have a severely negative impact (for instance, accidentally publishing an embargoed post that still wasn't safe to publish).

The solution will be to clear the post date value, but I'm undecided as to whether we should do that when a scheduled post is trashed, or when it's restored from the trash.

Change History (3)

#1 @lukecavanagh
8 years ago


Makes sense to default that post status back to draft.

#2 @mbijon
8 years ago

Doing something a user doesn't expect definitely makes this worth prioritizing. Clearing the scheduled post date seems like an easy fix too.

Only things I'd suggest are:

  • Show an in-admin alert to the effect of "Doing this will/has clear(ed) the scheduled post date."
  • Add an action so devs can detect & use this event from custom schedulers

#3 @johnbillion
4 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

This is a nasty one! I think it can be covered by #23022. Restoring any post from the trash should restore it to draft status to avoid unexpectedly publishing or re-publishing previously trashed content.

Note: See TracTickets for help on using tickets.