[Resolved] Hide/Disable comment URL field

Home Forums Support [Resolved] Hide/Disable comment URL field

Home Forums Support Hide/Disable comment URL field

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #677330
    ETO

    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.

    #677342
    Leo
    Staff
    Customer Support
    #677367
    ETO

    Thank you, but this function disables both e-mail and URL fields. I would like to remove only URL field.

    #677407
    Leo
    Staff
    Customer Support

    Have you tried removing the unset($fields['email']); line?

    Or does that not work?

    #824805
    Simon

    Thanks for this Leo. Just implimented it (with unset($fields[’email’]); removed) and it works perfectly.

    #824838
    Leo
    Staff
    Customer Support

    No problem 🙂

    #1363747
    Ricardo

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

    #1363803
    Leo
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.