Posted By

tcmacdonald on 03/19/10



Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Delete all Wordpress posts that carry a specific term ID

 / Published in: MySQL

  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  

You need to login to post a comment.