• Please, how can I just remove all the fields (name, email, etc.) from my comment form? If you are kind enough to give me the code, please kindly also tell me where in comments.php to put it exactly, as I am new at this. Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator t-p

    (@t-p)

    how can I just remove all the fields

    Do you want to remove the entire comment form, totally?

    Dion

    (@diondesigns)

    You would need to add the following to the theme’s functions.php file:

    function remove_comment_fields($fields) {
    	return array(
    		'author' => '',
    		'email'  => '',
    		'url'    => '',
    	);
    }
    add_filter('comment_form_default_fields', 'remove_comment_fields');

    Then make sure your theme is not adding these fields when it calls the comment_form() function in comments.php.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove all fields in comment form.’ is closed to new replies.