WP Query – duplicated posts once including tags in search results

Adding this inside the WHILE LOOP will solve the problem.
It will skip the post in the loop if this post ID is present in our array (meaning, same post went through the loop before).

<?php 

    // MAKE SURE YOU DECLARE $postsIDsArray= array(); outside of the loop, on top of it
    $postID = $search->post->ID;

    // if this ID is present in the array, skip this post
    if (in_array($postID, $postsIDsArray)) continue;

    // if the ID is not present, add this ID to the array
    array_push($postsIDsArray, $postID);

?>