How to Remove Email Field or Website URL Field from WordPress Comment form

This is one of the thing many people wants to do, the reason for writing this article is because i have once run into this with my client website when she said she want people to easily leave comment without having to go through the stress of entering email and for so many times my clients will want me to remove the website field from the comment form of wordpress.

remove email and website url from wordpress

On my search online for how to have this done almost yield me no good result but wish i have latter find out and would want to share it with you guys. For any reason you want to remove the website field and email field from your wordpress website comment form just add the code below to your theme functions.php. Be careful when adding the code below so you don’t break your website. If you are a newbie you can read this article by wpbeginner on how to safely add code to wordpress site. If you mistakenly break your wordpress theme and your site refuse to open then read this article how to fix wordpress broken website caused by theme.

ALSO READ  Nigerian Youths, Music and "Blow" Syndrome: PART ONE

Now let proceed, go to your wordpress dashboard and go to Appearance >>> Editor >>> Functions.php and add the below code.

 <!--?php function remove_website_email_field( $fields ){ if(isset($fields['url'], $fields['email'])) //remove $fields['email'] for only website field unset($fields['url'], $fields['email']); //remove $fields['email'] for only website field return $fields; } add_filter( 'comment_form_default_fields', 'remove_website_email_field' ); ?-->

This code will remove the email field and website url field on your wordpress comment form. note that you must remove the “Comment author must fill out name and email“. You can do that by going to your wordpress dashboard and go to Settings >>> Discussion and then remove the “Comment author must fill out name and email”

uncheck email required

If this is not done then people won’t be able to comment on your site as they will still be required to enter email were as email field won’t be shown to them.

ALSO READ  How to Become a Successful Blogger in Nigeria, Africa

If you need to remove only the email field from your wordpress comment box then add the below code to your theme functions.php

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

This will remove only the email field from your wordpress site comment form.

If you would want to remove website field only from your comment form the i recommend you use a wordpress plugin called Remove Comment Website/URL Box to archive this.

This  how you can easily remove email field or website url field from wordpress comment form


The Author


Bringing you the right informations. Touching every corner, exposing the true facts. Yes! It's Information Hood leaving nothing untouch. (Your loyal Serome)

Leave a Reply

Your email address will not be published.

Information Hood © 2016 - 2019 Follow us on Facebook