Site logo

Archived topic

Hide/Disable comment URL field

7 replies · Started by ETO on September 14, 2018

Viewing posts 1–8 of 8

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.

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;
}

This archived topic is closed to new replies.