Post Pic

How to remove the url field from WordPress comment form

In some cases, you may not need or want that people who comment your posts can leave their website url. Here is a simple code snippet to remove the url field from WordPress comment form.

Paste the code below into your functions.php file. Once saved, the url field will be removed from your comment form.

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

Thanks to WP Tuts for the tip!

4 Responses

Aug 11 2012 08:00

I have seen Smashing Magazine’ Comment Form, URL field doesn’t show up, I added the code and its working fine.

Aug 14 2012 20:01

A big thanks for this code, really need this one.

Sep 04 2012 16:19

It’s really help alot but why not used nofollow in the hyperlink instead remove the url?

Nov 07 2012 19:41

Additional methods:
- you can just comment out the PHP line
- you can add a class or ID on that line and then hide it from CSS.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox