This snippet changes the default ‘Leave a Reply’ heading that appears above the comment form on WordPress posts, allowing you to use custom text that better fits your site’s tone or branding. Just change the text in the code snippet where you see the comment.
function bb_change_leave_reply_text($translated_text, $text, $domain) {
if ($text === 'Leave a Reply') {
$translated_text = 'Write Your Comment'; // Replace with your custom text
}
return $translated_text;
}
add_filter('gettext', 'bb_change_leave_reply_text', 20, 3);
If you’re using a custom post type, like ‘recipes’ for example, you might want to only change the text on that post type. This snippets allows you to do that by defining the post type in the snippet. Change ‘post’ to your custom post type where indicated by the comment.
function bb_change_leave_reply_text($translated_text, $text, $domain) {
global $post;
if ($text === 'Leave a Reply' && get_post_type($post) === 'post') { // Replace 'post' with your post type - example: 'recipe'
$translated_text = 'Tells us how it turned out'; // Replace with your custom text
}
return $translated_text;
}
add_filter('gettext', 'bb_change_leave_reply_text', 20, 3);
Pro Pass Membership
Want access to all current and future child themes, kits, and our B&B Blocks library for Kadence for one low annual price?









