In this article am sharing how to edit comment form, modify comment form, delete comment form, add comment form and delete texts like required fields are marked *, Name, email and website in comment section.
Sometimes we like to edit comment form WordPress as our wish. We use comment form to get comment from visitors about the post. In the comment form, the fields “Your email address will not be published required fields are marked *”, Name, email and website are available default. You can change those texts.
If you search in WordPress support forum you will get something like you have to change the code in comment.php.
How to edit comment form WordPress
As per WordPress support forum, code to be changed like below
From php comment_form(); ?> to
‘You do not have to leave an email address in order to reply.’)); ?>
But this won’t work in latest WordPress version i.e. above 3.3. Then what will work? If you change the comment template it will work. That mean by changing or modifying the comment template you can edit comment form in WordPress latest version.
How to modify your comment template in WordPress
- Login in to you Control Panel.
- Open wp-includes folder from File Manager.
- Select comment-template.php and Click Edit.
- Go to the line 1541 or search for ‘’ Near to this you can see “Your email address will not be published. Required fields are marked *”
- Change/Modify the text as your wish like aTechguide.com assured we won’t sell your email id.
- In Line 1527 you can see the array for comment fields.
$fields = array(
'author' => '<p>' . '<label for="author">' . __( 'Name' ) . '</label> ' . ( $req ? '<span>*</span>' : '' ) .
'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' />',
'email' => '<p><label for="email">' . __( 'Email' ) . '</label> ' . ( $req ? '<span>*</span>' : '' ) .
'<input id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />',
'url' => '<p><label for="url">' . __( 'Website' ) . '</label>' .
'<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />',
Now you can change the field how you want. Example If you want to change Name to Your Name, you can change in comment template like this
<label for=”author”>’ . __( ‘Your Name’ )
Like this you can change Name *, Email *, Website and comment in your WordPress blog