How to change submit button value in comment from “Post Comment” to “Send”

Open comments.php file inside your theme’s folder

<?php if ( comments_open() ) : ?>

<?php
$fields = array(
    'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name', 'responsive' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
    '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" /></p>',
    'email'  => '<p class="comment-form-email"><label for="email">' . __( 'E-mail', 'responsive' ) . '</label> ' . ( $req ? '<span class="required">*</span>' : '' ) .
    '<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30" /></p>',
    'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website', 'responsive' ) . '</label>' .
    '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
);

$defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', $fields ),'label_submit'=>__('Send') );

comment_form( $defaults );
?>

The comment_form() function is responsible to display the comment form.

It’s argument is an array.

The $default you see in the code is an array which contains other arrays as it’s items.

The ‘fields’ items takes array for input fields The ‘label_submit’ is used to change the label for submit button

You can read more at codex.wordpress.org/Function_Reference/comment_form

Leave a Comment