Delete all Wordpress posts that carry a specific term ID

/ Published in: MySQL
Save to your folder(s)

Copy this code and paste it in your HTML
  1. delete from wp_posts where ID in (select wp_term_relationships.object_id from wp_term_relationships
  2. left join wp_term_taxonomy on wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id
  3. left join wp_terms on wp_term_taxonomy.term_id = wp_terms.term_id
  4. where wp_terms.term_id = 3);

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.