Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require "wp-config.php";
- $rows = $wpdb->get_col("SELECT t.translation_id FROM wp_icl_translations t
- LEFT JOIN wp_comments c ON t.element_id = c.comment_ID
- WHERE t.element_type = 'comment' AND c.comment_ID IS NULL");
- echo sizeof($rows) . " to be deleted. ";
- if (!empty($rows)) {
- $affected = $wpdb->query("DELETE FROM {$wpdb->prefix}icl_translations WHERE translation_id IN (".implode(',',$rows).")");
- echo $affected . " rows deleted. ";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment