How to change the “Leave a comment” text in WordPress ?

⚠️ Code snippets might not be compatible with the latest version of your theme. Always use a child theme to customize your theme, and test your code on a staging website before migrating to production.

This text can be altered with a WordPress filter hook comment_form_defaults

In the following code, simply replace Custom leave a comment by your own text :

 

add_filter('comment_form_defaults', 'set_my_comment_title', 20);
function set_my_comment_title( $defaults ){
  $defaults['title_reply'] = __('Custom leave a comment', 'customizr-child');
  return $defaults;
}

Leave a comment

Your email address will not be published. Required fields are marked *

One thought on “How to change the “Leave a comment” text in WordPress ?”