Remove URL Field from WordPress Comment Form

WordPress comments come by default with a field named “Website” or “URL”. If you want to remove this field, whether for design or to remove a field that is usually unnecessary, use the following snippet in functions.php:

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

This uses a WordPress filter. Learn more in WordPress Hooks Explained.

Discussion
[  0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!