WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. phalancs
    Member
    Posted 1 year ago #

    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

  2. phalancs
    Member
    Posted 1 year ago #

    Easy, you can use this command. Simply add your Dateabasename.

    UPDATE 'DATABASE'.'wp_posts' SET 'post_status' = 'publish' WHERE 'wp_posts'.'post_status' = 'trash';

  3. Aaron
    Member
    Posted 1 year ago #

    Run this in phpmyadmin

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

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

  4. phalancs
    Member
    Posted 1 year ago #

    Thanx both you and me :)

  5. phalancs
    Member
    Posted 1 year ago #

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

    UPDATE wp_posts SET post_status = 'draft' WHERE post_status = 'trash';

  6. Aaron
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags