WordPress.org

Support

Support » How-To and Troubleshooting » Move all Trashed Posts to Draft Status? (MySql or sth?)

Move all Trashed Posts to Draft Status? (MySql or sth?)

  • Hi!

    Is there any idea on how to move all posts in trash back to draft status? Maybe via a MySql statement? I trashed many posts with the “broken link checker” but I want to review them so I need them back in at least draft status.

    Thanx in advance. The Blog I am talking about: http://www.lolr.de

Viewing 5 replies - 1 through 5 (of 5 total)
  • Easy, you can use this command. Simply add your Dateabasename.

    UPDATE ‘DATABASE’.’wp_posts’ SET ‘post_status’ = ‘publish’ WHERE ‘wp_posts’.’post_status’ = ‘trash’;

    Run this in phpmyadmin

    UPDATE wp_posts SET post_status = 'published' WHERE post_status = 'trash'

    *edit – Did you just answer your own question???

    Thanx both you and me 🙂

    Phew, we both made the same error, of cause its:

    UPDATE wp_posts SET post_status = ‘draft’ WHERE post_status = ‘trash’;

    Ya I didn’t see you said draft. But yes you are correct.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Move all Trashed Posts to Draft Status? (MySql or sth?)’ is closed to new replies.