How to Remove URL Field from the WordPress Comments Form

If you do not want to show the URL field in your comment form then you can easily hide it from your visitor. In this article, you can find a simple snippet that will show you how to remove the URL Field from your WordPress Comments form without modifying it.

Open your functions.php file and insert this function:


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

Leave a Reply

Your email address will not be published. Required fields are marked *