You are viewing an old revision of this post, from March 15, 2015 @ 12:37:15. See below for differences between this version and the current revision.

Bulk delete WordPress posts

Taken from WP Stackexchange Don't try to Bulk delete WordPress posts with SQL. There is post information is multiple tables. You will end up with orphan data scattered throughout the database. While it is possible to write the JOINs you'd need to delete everything, the SQL could be complex. Create a simple Loop and use the Core to delete your posts. [php]$args = array( 'post_type' => 'post', 'ignore_sticky_posts' => true, ); $del = new WP_Query( $args ); while ($del->have_posts()) { $del->the_post(); wp_delete_post( $post->ID, false ); }[/php]

Revisions

  • March 15, 2015 @ 12:37:15 [Current Revision] by PeterLugg
  • March 15, 2015 @ 12:37:15 by PeterLugg

Revision Differences

There are no differences between the March 15, 2015 @ 12:37:15 revision and the current revision. (Maybe only post meta information was changed.)

Tags: ,

No comments yet.

Leave a Reply