
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.

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
I have seen Smashing Magazine’ Comment Form, URL field doesn’t show up, I added the code and its working fine.
A big thanks for this code, really need this one.
It’s really help alot but why not used nofollow in the hyperlink instead remove the url?
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: