Site logo

Archived topic

Remove URL field in comment box

7 replies · Started by albabes on May 29, 2019

Viewing posts 1–8 of 8

Im using code from wpbeginner to do this, but its not working.
Using SNIPPES plugin, with option, ""Run snippet everywhere" but no JOY.

function wpbeginner_remove_comment_url($arg) {
    $arg['url'] = '';
    return $arg;
}
add_filter('comment_form_default_fields', 'wpbeginner_remove_comment_url');

PS., I dont want this option here
https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/

Thanks

Hi there,

Our PHP snippet should work. Why don't you want to use it?

Cause I dont wanna uncheck that thing? Who would want spam exposure?

I'm confused. You want to remove this field correct?
https://www.screencast.com/t/y2y02BFU3qq

If so have you actually tried our snippet?

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

I just tested and it works?
https://www.screencast.com/t/q9aOj4fXInDP

Ahh ok.

I'll try to make it more clear :)

Please point out the bad info on that page to Tom, so it can be edited out.

I never post here until I search here thoroughly first for an answer. Don't went to waste GP's time Leo.

AL

I'm in charge of documentations and will take a look :)

This archived topic is closed to new replies.