The generate_comments_title_output filter allows you to change the output of the comment title element.
For example, if we want to change the comment title from
to
, then we can we this PHP snippet:
add_filter( 'generate_comments_title_output', function( $output, $comments_title ) {
return sprintf(
'
',
esc_html( $comments_title )
);
}, 10, 2 );