Change ‘Leave a comment’ title H3 to H4 tag in Astra Theme

By default ‘Leave a Comment’ title is H3 tag in the Astra theme. You can easily change this to a different headline tag say H4 using custom code. Following code will change ‘Leave a Comment’ title tag from H3 to H4.

PHP Snippet: Leave a comment from H3 to H4 tag

In the WordPress Dashboard, go to Appearance > Theme Editor and open the functions.php file of your Astra chid theme. Then add the following code at the end.

add_filter( 'astra_comment_form_default_markup', function( $args ) {
$args['title_reply_before'] = '<h4 id="reply-title" class="comment-reply-title">';
$args['title_reply_after'] = '</h4>';
return $args;
});
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.