6

Someone moved a very important page on my website into the trash, and I do not know who did it! It was not deleted permanently so I don't need to worry, in that sense.

The revisions, when I restored it, show that someone edited it 3 days prior to today, so it could have been them, but I can't be sure.

Does WP keep track of who clicks the trash button? If not, I presume I'd have to write a custom script to hook onto the trash button, when clicked.

  • 1
    Now would be an excellent time to set up a regular backup, code and database, and put together a recovery plan. – Andrew Bartel Jun 20 '14 at 18:08
  • @AndrewBartel I've got backupbuddy running daily, just in case. – Jacob Raccuia Jun 20 '14 at 19:05
5

By default, no, WordPress doesn't keep track of who changes post statuses (at least that I can see).

you can hook into transition_post_status and log the user id.

    add_action( 'transition_post_status', 'wwm_transition_post_status', 10, 3 );

    function wwm_transition_post_status( $new_status, $old_status, $post ) {
     if ( 'trash' == $new_status ) {
      $uid = get_current_user_id();
      //somehow or another log the $uid with the $post->ID
     }
    }
1

No, natively WordPress does not log any activity. While plugins for it exist, they won't work retroactively.

However don't forget that any action taken in WordPress is technically a HTTP request, such as page load, form submit, or Ajax request.

These are often logged pretty thoroughly in web server's access log and if available it's pretty realistic to reconstruct action that happened and details like user's IP from them.

0

WP can dot do it, but you can go to server logs and found user IP. It may need some effort and success is not guaranteed but this is the only possible way. Will's answer helps you in future mistakes.

Finding user base on his IP is not usually hard specially if number of authors were limited.

0

There is a free plugin called Stream that will make your life much easier. Search within the WordPress plugins page. It logs all changes to posts and who is responsible for them.

  • First of all, recommending a plugin is not a great answer, actualy not done here! Secondly, if you want your data shared with a 3rd party company (in the cloud theirs) have fun and tell your users also why you share that info with them. If privacy is at least meaning some to you as website owner I would say, stay away from plugins like Stream! – Charles Aug 14 '15 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.