$('h2').each(function() {
    const $headline = $(this);
    if ($headline.next().is('h2')) {
      $headline.remove();
    }