How to Remove URL Field From WordPress Comment Form

 how to control spam comments on your WordPress powered websites and Remove Url Field From WordPress.

It is true that WordPress websites attract a lot of spammers as most of them know how easy it is to build backlinks off from them. Most bloggers do not know how to control spam and they do not have the time to moderate each comment.

Notice that these spammers do not use their real name and always leave a backlink to a site, which in most cases may not be related to your website.

The perfect way to discourage spam is to remove the “Website” or “URL” field entirely from your WordPress website.

Remove Url Field From WordPress

Let’s think about it, the “Website” field is not useful in most cases, as genuine commenters probably do not own a website and it simply allows spammers to build links to their websites. The more comments containing backlinks will cause your posts to have more outbound links and it will cause harm to your SEO efforts.

There are two methods we can use to remove the website field from comments.

1. Using Plugins to disable Website field from comments

There are many plugins available in the WordPress repository that remove the Website field from the blog comments.

The most easy way is to install Remove Fields or Remove Comment Website/URL Box.

Navigate to WP-Admin -> Plugins -> Add New and search for “Remove Fields” and install and activate the plugin.

Remove Url Field From WordPress

After the successful completion of the installation process, activate the plugin to remove the Website field from blog comments.

RemoveField-Activate

For many, this is an easy way out. However, some people may not want to use more plugins on their WordPress website and might prefer editing the WordPress files. Create a backup before making any changes to the files.

2. Editing the WordPress Files to remove the Website field from comments

This method is only suggested to those who are well versed in editing WordPress files and also maintain complete documentation and backups of their WordPress websites.

Navigate to WP Admin -> Appearance -> Editor and select functions.php (It is also known as “Theme Functions”.)

Remove Url Field From WordPress

Insert the following code at the last line in the functions.php

  1. add_filter(‘comment_form_default_fields’, ‘website_remove’);
  2. function website_remove($fields)
  3. {
  4. if(isset($fields[‘url’]))
  5. unset($fields[‘url’]);
  6. return $fields;
  7. }

The code above creates a function called website_remove() and removes (or unsets) the URL field.

Using the Hook add_filter(), we pass the argument to default WordPress function comment_form_default_fields that contain fields of the comment form.

Remove Url Field From WordPress Option-3

You may want to use this simple WordPress Plugin.

Remove Url Field From WordPress Option-4

Add below code to your theme’s functions.php file.

add_filter(‘comment_form_field_url’, ‘__return_false’);

This code will disable URL field from WordPress comment form

If you are a constant target of comment link spam and you have very little time to moderate the comments, then removing the website field entirely will seriously discourage the link spammers.

Read More

Leave a Reply