Site logo

Archived topic

Remove/Hide Comment URL

11 replies · Started by Tudor M on March 27, 2015

Viewing posts 1–12 of 12

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

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/

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

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

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

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

...

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

No worries! Glad it's working :)

unsubcribe 2

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

Glad you figured out :)

This archived topic is closed to new replies.