Removing posts by sql

You’re probably better off doing this with wordpress functions and adding a button which would delete all posts (or even having a shortcode that, when loaded, would do it). The reason I recommend doing this instead of SQL directly is that wp_delete_post() will take all the associated meta with it, which saves you having to do complicated SQL. You can combine this with WP_Query to get posts given a complex set of desired parameters and then loop through them to remove them.

tech