Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create temporary table `cull` (`post` int);
- insert into cull select ID from wp_85affce725_posts where post_status = 'publish';
- delete from wp_85affce725_posts where ID in ( select post from cull );
- delete from wp_85affce725_posts where post_parent in ( select post from cull );
- -- done with temp table, cleanup metadata
- delete from wp_85affce725_postmeta where post_id not in ( select ID from wp_85affce725_posts );
- delete from wp_85affce725_comments where comment_post_id not in ( select ID from wp_85affce725_posts );
- delete from wp_85affce725_commentmeta where comment_id not in ( select comment_ID from wp_85affce725_comments );
- delete from wp_85affce725_term_relationships where object_id not in ( select ID from wp_85affce725_posts );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement