I need to hide/disable the text-area comment field, and only display author field. I've succeeded in doing this with the code below.


Text-area comment input is hidden, but is still required, meaning when you enter your name and hit Sign, this error is shown: Error: Please type your comment text. from url https://theplaydesignmanifesto.org/wp-comments-post.php


How can I make the comment input field 'comment' un-required?


Current code

As you can see, I attempt to unset the 'comment' field and not display it afterwards. I've added this code in functions.php

add_filter( 'comment_form_fields', 'custom_comment_field' );
function custom_comment_field( $fields ) {
    // What fields you want to control.
    $comment_field = $fields['author'];
    $comment_field = $fields['comment'];

    // The fields you want to unset (remove).

    // Display the fields to your own taste.
    // The order in which you place them will determine in what order they are displayed.
    $fields['author'] = '<p class="comment-form-author"><label for="author">Name <span class="required">*</span></label><input type="text" id="author" name="author" required="required" placeholder="Name"></p>';
    return $fields;

Code source: https://developer.wordpress.org/reference/hooks/comment_form_fields/

Previously answered threads like this I've tried

How to make comment text field un-required?

1 Answer 1


After a lot of trial-and-error from other questions and sources, I discovered the allow_empty_comment filter.

This simple filter allowed me to submit comments without filling in the actual "comment" box.

add_filter( 'allow_empty_comment', '__return_true' );

More info here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.