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 <h3>
to <p>
, then we can we this PHP snippet:
add_filter( 'generate_comments_title_output', function( $output, $comments_title ) {
return sprintf(
'<p class="comments-title">%s</p>',
esc_html( $comments_title )
);
}, 10, 2 );