Title: Remove Required Comment Textarea?
Last modified: January 10, 2018

---

# Remove Required Comment Textarea?

 *  Resolved [WPAddiction](https://wordpress.org/support/users/wpaddiction/)
 * (@wpaddiction)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/remove-required-comment-textarea-2/)
 * Does this plugin have any options to remove or replace the required comment textarea?
   I would like the only required field to be a video URL and don’t really have 
   a use for a textarea. Any help would be greatly appreciated.
 * For additional information, you can see my original support post at [https://wordpress.org/support/topic/remove-required-comment-textarea/](https://wordpress.org/support/topic/remove-required-comment-textarea/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fremove-required-comment-textarea-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [N-Media](https://wordpress.org/support/users/nmedia/)
 * (@nmedia)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/remove-required-comment-textarea-2/#post-9857742)
 * Hi,
 * Sorry, it does not remove comment fields, It suppose to add extra fields with
   comments.
 *  Thread Starter [WPAddiction](https://wordpress.org/support/users/wpaddiction/)
 * (@wpaddiction)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/remove-required-comment-textarea-2/#post-9860772)
 * Thank you for the quick response, just wanted to make sure that I wasn’t missing
   anything.
 *  [Pete](https://wordpress.org/support/users/perthmetro/)
 * (@perthmetro)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/remove-required-comment-textarea-2/#post-9989282)
 * This should do the trick…
    1. Insert this into your functions.php
 *     ```
       // add default comment
       function rei_preprocess_comment($comment_data) {
           if ($comment_data['comment_content'] == '%dummy-text%') {
               $comment_data['comment_content'] = ''; // replace dummy text.
           }
           return $comment_data;
       }
       add_filter('preprocess_comment', 'rei_preprocess_comment');
       function rei_wp_footer() {
           ?>
           <script>
           jQuery(function($){
               var comment = $('textarea#comment');
               comment.removeAttr('required'); // remove required attribute of textarea.
               $('#commentform').on('submit',function(){
                   if (comment.val() == '') {
                       comment.css('text-indent','-999px').val('%dummy-text%'); // change to dummy text.
                   }
               });
           });
           </script>
           <?php
       }
       add_action( 'wp_footer', 'rei_wp_footer' );
       ```
   
 * 2. Use css to hide comment box
 *  Plugin Author [N-Media](https://wordpress.org/support/users/nmedia/)
 * (@nmedia)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/remove-required-comment-textarea-2/#post-10014102)
 * Thanks for sharing.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Remove Required Comment Textarea?’ is closed to new replies.

 * ![](https://ps.w.org/wp-comment-fields/assets/icon-256x256.png?rev=3625402)
 * [Comments Extra Fields For Post,Pages and CPT](https://wordpress.org/plugins/wp-comment-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-comment-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-comment-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-comment-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-comment-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-comment-fields/reviews/)

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [require()](https://wordpress.org/support/topic-tag/require/)

 * 4 replies
 * 3 participants
 * Last reply from: [N-Media](https://wordpress.org/support/users/nmedia/)
 * Last activity: [8 years, 5 months ago](https://wordpress.org/support/topic/remove-required-comment-textarea-2/#post-10014102)
 * Status: resolved