Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Created February 12, 2014 16:47
Show Gist options
  • Select an option

  • Save wpsmith/8959454 to your computer and use it in GitHub Desktop.

Select an option

Save wpsmith/8959454 to your computer and use it in GitHub Desktop.

Revisions

  1. wpsmith created this gist Feb 12, 2014.
    5 changes: 5 additions & 0 deletions delete-posts.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    DELETE a,b,c
    FROM {PREFIX}_posts a
    LEFT JOIN {PREFIX}_term_relationships b ON (a.ID = b.object_id)
    LEFT JOIN {PREFIX}_postmeta c ON (a.ID = c.post_id)
    WHERE a.post_type = 'POST_TYPE' AND a.post_date < '2014-01-01'