[Resolved] Remove URL field in comment box

Home Forums Support [Resolved] Remove URL field in comment box

Home Forums Support Remove URL field in comment box

  • This topic has 7 replies, 2 voices, and was last updated 4 years ago by Leo.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #914676
    albabes

    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

    #914693
    Leo
    Staff
    Customer Support

    Hi there,

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

    #914817
    albabes

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

    #914841
    Leo
    Staff
    Customer Support

    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

    #914877
    albabes

    Because Leo, the GP page says:
    https://docs.generatepress.com/article/remove-e-mail-and-url-field-from-comment-form/

    “If you would like to remove e-mail and URL field from comment form, first uncheck the requirement in Settings > Discussion:”

    And I didnt want to do that.

    So how about editing that erroneous page?
    If the page didnt say that sentence, I never would of opened this ticket.

    AL

    #914881
    Leo
    Staff
    Customer Support

    Ahh ok.

    I’ll try to make it more clear ๐Ÿ™‚

    #915581
    albabes

    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

    #915588
    Leo
    Staff
    Customer Support

    I’m in charge of documentations and will take a look ๐Ÿ™‚

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.