Archived topic
disabling website field in comment form
7 replies · Started by manaadiar on April 27, 2020
Hi there, can you pls assist with this.. I have tried many things including below code suggested in GP forums.. But it is not working on my site..
add_action( 'after_setup_theme', 'tu_add_comment_url_filter' );
function tu_add_comment_url_filter() {
add_filter( 'comment_form_default_fields', 'tu_disable_comment_url', 20 );
}
function tu_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}

Hi there,
The Filter function you have tried only works with the default WordPress comments form.
And it looks like you're using a plugin for that comment form. Have you checked with the plugin author?
Hi David, yes I did check with the plugin author.. See the point is when i go into Developer mode in Chrome and edit html and add style=display:none to the div class="comment-form-field comment-form-url" the website field is hiding, but I am not sure how to add it to the css of the theme so it stays hidden..
Can you assist, pls thanks..
Not sure if I understand.
Did the plugin author offer the CSS?
If so you can add it using one of these methods:
Adding CSS: https://docs.generatepress.com/article/adding-css/
I just checked a post and didn't see any of those fields:
https://www.screencast.com/t/Jffl0G2w
Hi Leo, if you look at the thread there is a screenshot of what it looks like.. Your screen shot shows the unexpanded version.. You need to click the Enter your Comment here.. block and the form will appear..
You can see the expanded version here.. comments
Reg the CSS i know how and where to add additional CSS.. I just was hoping you have some suggestions on how to add this particular display:none code so it can work on the live site.. it works in chrome when it is id developer mode..
Jetpack comments form is displayed using an iFrame being served from the jetpack website - which means you cannot edit those styles locally. The CSS changes would have to be made by Jetpack. May want to ask their support again as it seems odd you cannot disable that field.
There is no option under Jetpack..
Unfortunately there is nothing we can do to change that - you would need to ask Jetpacks support if they have added any hooks to allow that field to be removed.