I am running up a large amount of aggregated posts, too big for MySQL to handle. Mass deleting posts thru existing plugins takes too long, and hits system timeouts.
I found this post listing an SQL script to delete posts thru PHPMyAdmin:
delete a,b,c,d FROM wp_posts a LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id ) LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id ) LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id ) LEFT JOIN wp_terms e ON ( e.term_id = d.term_id ) WHERE e.term_id =<category id>
(where <category id> is the category id number)
This seems to work well for "normal" posts, but I think this would not clean up post metadata correctly.
Does someone know the correct script to mass delete aggregated posts, with its metadata?