How to remove fields from a WordPress comment form

Written by 06.02.2019

Remove email from a wordpress comment form

To remove unnecessary fields, like email, name (author), website (url) from a WordPress comment form use this snippet (just remove rows with the fields which you want to leave in the form):

function remove_fields_from_comment_form($fields) {
	if(isset($fields['email'])) unset($fields['email']);
	if(isset($fields['author'])) unset($fields['author']);
	if(isset($fields['url'])) unset($fields['url']);
	return $fields;
add_filter('comment_form_default_fields', 'remove_fields_from_comment_form');

Leave a Reply

Your email address will not be published. Required fields are marked *