Remove the Name, Email & Website and Check Box from the comment form in WordPress.

Remove Fields Website - Name - email & Check Box from comment form

The folloing PHP will remove the Name, Email & Website and check Box from the comment form in wordpress.

Use this code to make your own plugin

You might need to edit it to add Boxes back in...

<?php
/*
Plugin Name: Get Rid of Name Email Website box

//This removes the Check box for save email address
add_filter( 'comment_form_default_fields', 'tu_comment_form_hide_cookies_consent' );
function tu_comment_form_hide_cookies_consent( $fields ) {
unset( $fields['cookies'] );
return $fields;
}
//This remove fields Website (url) - Name (author) - email
//Remove eg $fields['url'], to add the Website field back in
function remove_website_name_email_field( $fields ){
if(isset($fields['url'],$fields['author'],$fields['email']))
unset($fields['url'],$fields['author'],$fields['email']);
return $fields;
}

add_filter( 'comment_form_default_fields', 'remove_website_name_email_field' );

?>

Leave a Comment

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