Remove 'website' field from comment form on posts

Hi,

I’m trying to remove the ‘website’ entry field from my comment form on blog posts. I tried entering this code into my functions.php, but it it did not remove the field.

add_filter(‘comment_form_default_fields’, ‘website_remove’);
function website_remove($fields)
{
if(isset($fields[‘url’]))
unset($fields[‘url’]);
return $fields;
}

Would appreciate any help regarding this.
Website is https://god.net/

Hi @SeekGod,

The code you are using should work if you correctly added it to the child theme’s functions.php.

Please this try:

add_filter('comment_form_default_fields', 'unset_url_field');
function unset_url_field($fields){
    if(isset($fields['url']))
       unset($fields['url']);
       return $fields;
}

If the comment form is still present, please provide us with the admin access to your site in a Secure Note:

Hi,

Yes, I added the code you provided into my child theme’s function.php. Still is not working.

Hello @SeekGod,

Thanks for updating the thread.

You can try to remove the website URL field using following CSS under Pro > Theme Options > CSS:

.comment-form-url {
    display: none;
}

.form-submit {
    clear: both;
}

1- I have found the proper CSS code selector using the Chrome browser Developer Toolbar: https://www.youtube.com/watch?v=wcFnnxfA70g

2- For the CSS code itself, I suggest that you get started with this tutorial: https://www.youtube.com/watch?v=yfoY53QXEnI

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.