• hey there. seeking to delete Scheduled posts. the SQL query i *believe* i’m after is as follows (but i’m worried about orphaned tables):

    DELETE FROM wp_posts WHERE post_date < ‘2010-01-01 17:00:00’ AND post_status = ‘what string here??

    i tried it, but no rows are deleted.

    essentially, am looking to speed up my blog due to the following problems:

    All (31,885) |
    Published (29,953) |
    Scheduled (1,829) |
    Drafts (100) |
    Private (3) |
    Trash (118)

    – Bulk Delete plugin = times out
    – Showing 999 posts then deleting = server fail

    any SQL query help i can ram into PhPMyAdmin to help out would be excellent!

    thank you in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I think scheduled posts are just posts with a post_date in the future.Perhaps you could just change the post_date condition.

    Do backup your database before trying.

    Thread Starter mo0

    (@mo0)

    hm, i attempted to put ‘future’ in there as a condition – but no luck. the scheduled posts are all ones that have missed their schedule (as they’re feeds).

    appreciate the reply. any other thoughts??

    By ‘future’ I meant post_date > NOW().

    But since you say they’ve missed their schedule that probably won’t work. Is there anything their database entries have in common?

    Thread Starter mo0

    (@mo0)

    hm, nothing beyond their dates being in the past, which is why the string of the date being < 2010 was in there.

    what would post_status be? i looked into the raw post table, which is where i got the ‘future’ status from.

    delete from wp_posts where post_status='future'

    Did you try something like the above?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SQL Query for Deleting 'Scheduled' Posts’ is closed to new replies.