$args = array(
'post_type' => 'post',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'post_tag',
'operator' => 'NOT EXISTS',
)
)
);
$query = new WP_Query( $args );
foreach($query->query() as $post){
wp_delete_post($post->ID);
}