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

One response on “How to Remove Website URL From WordPress Comments without plugin?

  1. Freddy G. Cabrera

    Hey what a neat way to get rid of the website field for the WordPress Comments!

    I personally don’t mind it. I actually like people linking back to their blog homepage as long as it is a relevant website to mine.

    Thanks for sharing this trick! ๐Ÿ˜€

    Cheers! ๐Ÿ™‚

Leave a Reply to Freddy G. Cabrera Cancel reply

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