[Resolved] Remove/Hide Comment URL

Home Forums Support [Resolved] Remove/Hide Comment URL

Home Forums Support Remove/Hide Comment URL

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #92030
    Tudor M

    Hi,

    I would like to hide the comment url/website so the user can’t insert a link.

    And I wan’t to also remove the link from the author of the comment (the spammers also inserts their links to the author url field even if I hide it).

    Any ideeas how to do that?

    Thank you

    #92220
    Tom
    Lead Developer
    Lead Developer

    This PHP snippet should work:

    add_filter('comment_form_default_fields','generate_disable_comment_url');
    function generate_disable_comment_url($fields) {
        unset($fields['url']);
        return $fields;
    }

    You can add it using your child theme’s functions.php file, or a plugin like this: https://wordpress.org/plugins/code-snippets/

    #146446
    Alexander

    Hi Tom,

    This seems to have partly worked for me. If I do this wiht the code snippets plugin, my url field is still there in a different color. Could it be it is called upon in a CSS style sheet and therefor be put back as visible or something?

    Alexander

    #146531
    Tom
    Lead Developer
    Lead Developer

    Weird, can you link me the page so I can see?

    #146569
    Alexander

    Hmmm it looks different now from this afternoon on my work computer haha I sometimes think changing a lot of little things a lot of times makes wordpress confused, even if I empty the caches every time.

    Anyhooo page link:
    http://ajnorfield.com/and-so-it-begins/

    It is one of the blog posts, but the website url field still is shown, even after I now have activated (something I did not do this afternoon) the code snippet that you pasted in this topic.

    Alexander

    #146582
    Tom
    Lead Developer
    Lead Developer

    I’m not seeing the URL field on that post? Maybe try clearing your browser cache?

    #146584
    Alexander

    I really did empty my cache in both wordpress and my browser each time…

    Maybe dragon ghosts haunt my website. Well okay, sorry for wasting your time. It seems to be working 🙂

    Alexander

    #146586
    Tom
    Lead Developer
    Lead Developer

    No worries! Glad it’s working 🙂

    #146588
    Tudor M

    unsubcribe 2

    #618537
    Anil

    Hi, above snippets is not working.
    Is there any change in the code?

    #618542
    Anil
    #618682
    Leo
    Staff
    Customer Support

    Glad you figured out 🙂

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