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);


Add the PHP to your child theme’s functions.php file, or a code snippets plugin.

Code snippets are offered ‘as is’ and no support is provided. If you have customisation requirements, feel free to contact me for a quote.

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?

Brand & Build Pro Pass

Latest

In the shop

  • Kadence
    Lane Wordpress Theme for KadenceLane Wordpress Theme for Kadence

    for content creators

    £175.00

    View Details 🡢

  • Kadence
    Liora Child Theme for KadenceLiora Child Theme for Kadence

    for bloggers

    £175.00

    View Details 🡢