Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

How to Remove URL Field From WordPress Comment Form

August 6, 2014

3 Min Read
remove url field from wordpress
Reading Time: 3 minutes

Previously I had written about how blog comments are actually good for your SEO efforts and how to paginate them. In a later post, I also taught how to control spam comments on your WordPress powered websites.

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.

This is generally how a spam blog comment looks like.

Spam Comments in WP

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.

Website Field

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 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.

Install Remove FieldsAfter 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”.)

EditFunctionsphp

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

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

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.

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.

What do you think is the better way of tackling URL spam on your blog: using plugins or editing the core? Let us know about your views on this issue in the comments section below.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Start Growing with Cloudways Today!

We never compromise on performance, security, and support.

Ahsan Parwez

Ahsan is the Community Team Manager at Cloudways - A Managed Cloud Hosting Platform. He loves to solve problems and help Cloudways' clients in any aspect he can. In his free time, you can find him playing RTS PC games.

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!