Bulk Deleting Posts In WordPress using SQL and the WP Admin

While working on a WordPress project I needed to delete every post of a specific post type. I thought this little trick was worth sharing.

Run a simple Query to the database to move your post_type posts to the trash.

UPDATE wp_posts SET `post_status` = 'trash' WHERE post_type = 'my_post_type_here' 

Then, go to the post types trash in the WP Admin and click the “Empty Trash” button. Deleting posts this way will be sure WordPress does all the little clean up tasks.

If you have SSH access you can install and use the WP CLI too.

Author: Kevin

Howdy, I’m Kevin Dees. I’m the founder of Robojuice. It is a web strategy company focused on delivering a refined experience to partners. I’m also the creator of TypeRocket for WordPress.