How to Remove Website URL From WordPress Comments without plugin?

Many spammers are using WordPress comment to get a link back to their website, It is the most popular way to generate spam. You can hide URL field from the comments form by adding a simple function to your functions.php file.

You can also create a WordPress custom functions plugin to add all your custom functions, Google analytics and other codes.

If you are wondering What is Functions.php File in WordPress and How to Edit it?, We already have explained it.

To hide URL field from the WordPress comments form, simply add the following code to your functions.php file.

  1. Login to WordPress Dashboard
  2. Go to Appearance > Editor
  3. Select Theme Functions (functions.php) file.
  4. Add the following function and click update changes.

// Disable Comments URL field
function jlwp_disable_comment_url($fields) { 
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','jlwp_disable_comment_url');

That’s all, you need to do to hide the URL field from the WordPress comments form.


You May Also Like

Leave a Reply

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