• We are experiencing a weird situation where our posts are disappearing from our site in the middle of the night. I have added an action to the function.php to send me an email and write to the error log all the info of the posts being delete. Today I am getting messages saying that an user, which I include in the email has deleted the posts. I know for a fact that user is not working at the time that the post was deleted. Looking at the log, I can see that the post_name is: [post_name] => 2060193-autosave-v1. My suspicion is that this use has left the story loaded in the CMS on her machine and went home from the day. Autosave my be trying to save, but probably her user has been timed out, so it can not save. Weird, anybody has experience the same. I am going to do some testing on my own. Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    Auto saves are deleted when the parent post is updated. My unverified guess is that scheduling a post to be published is seen as an update when published, hence the related auto save is removed. It’s unsurprising that a scheduled post would publish in the middle of the night.

    Thread Starter davidarago

    (@davidarago)

    I have verified that the posts are not scheduled posts. We have experienced to instances of the post being deleted, and both instances was the same user. And in both instances was in the middle of the night.

    @bcworkz, thanks for your response.

    Moderator bcworkz

    (@bcworkz)

    Autosave my be trying to save, but probably her user has been timed out

    Good thought, but unlikely. The user’s auth cookie should be good for 24 hours. Still, it might have expired. Failure to update an auto save would not cause the removal of an existing one. The save process would not even try to access the DB for any reason if not authorized.

    I’ve no better explanation though. The loss of auto saves in the middle of the night should be of little consequence if users are consistent about saving their work. Then the only auto saves that exist overnight would then be versions the user really didn’t want to save anyway.

    Does your notification email have the exact time the deletion happened? Check the access log at that time (unless the notification has all the same information). Any request at the time might be a clue to the cause. Perhaps it’s due to a WP Cron process? If not, the IP for the removal request might be a clue.

    Thread Starter davidarago

    (@davidarago)

    Hi,

    The issue is that there is nothing in the log that indicates that the post was deleted. It is like it was deleted using a DELETE FROM .vs. wp_delete_post. We also checked for corruption on the database. I may have to set some BEFORE DELETE triggers. Thanks for your responses.

    Moderator bcworkz

    (@bcworkz)

    When there is unexplained missing data, I would normally suspect that the site may have been hacked. But missing only auto saves for a specific user? That would be awfully specific for a typical hack. As unlikely as it seems, it remains an outside possibility.

    In any case, if it’s not already being done, making periodic DB backups is always good practice. I’m sure you know this, but it’s worth mentioning anyway.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Auto Save Deleting Post’ is closed to new replies.