Change Comment Form Title
August 7, 2025 Β· AI Conversations
### β Example:
<?php
comment_form([
'title_reply' => 'Share Your Thoughts',
]);
?>
### π Other Useful Parameters You Can Customize:
– `'title_reply_to'` β Title when replying to a specific comment.
– `'cancel_reply_link'` β Text for the cancel reply link.
– `'label_submit'` β Text for the submit button.
### π§ Full Example:
<?php
comment_form([
'title_reply' => 'Leave a Comment',
'title_reply_to' => 'Replying to %s',
'cancel_reply_link' => 'Cancel Reply',
'label_submit' => 'Post Comment',
]);
?>
Let me know if you also want to style or conditionally change the title based on post type or other logic.
—
### β **Option 1: Override the `comment_field` argument**
<?php
comment_form([
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" required="required" placeholder="Write your comment here..."></textarea></p>',
]);
This completely removes the label and optionally adds a `placeholder`.
—
### β **Option 2: Use CSS to hide the label**
If you donβt want to change PHP, you can hide it via CSS:
.comment-form-comment label {
display: none;
}
—
### π Note:
– Make sure `required="required"` is kept in the “ if you remove the label.
– Using `placeholder` helps preserve accessibility to some extent.
Let me know if you want to customize other fields too (like name, email, etc.).