Archived topic
Hide/Disable comment URL field
7 replies · Started by ETO on September 14, 2018
Hello,
How can I disable comment URL field? I had been using this plugin, but it doesn't work with GP. It would be great to do this without a plugin.
Hit here,
This should help: https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/
Thank you, but this function disables both e-mail and URL fields. I would like to remove only URL field.
Have you tried removing the unset($fields['email']); line?
Or does that not work?
Thanks for this Leo. Just implimented it (with unset($fields['email']); removed) and it works perfectly.
No problem :)
Hi
where do i add this php to remove the url field?
In functions php?
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']);
unset($fields['email']);
return $fields;
}