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.

Join our FREE webinar: Discover how Immunify360's advanced malware scanning secures your site. REGISTER NOW→

How to Remove URL Field From WordPress Comment Form

Updated on October 23, 2019

3 Min Read
remove url field from wordpress

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

Why Speed is Crucial for SEO & UX?

These expert tips will show you how to improve the speed of your WordPress Websites.

Thank You

Your Ebook is on its Way to Your Inbox.

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. Cloudways WordPress hosting has automated backups feature too.

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

Owais Khan

Owais works as a Marketing Manager at Cloudways (managed hosting platform) where he focuses on growth, demand generation, and strategic partnerships. With more than a decade of experience in digital marketing and B2B, Owais prefers to build systems that help teams achieve their full potential.

×

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

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour

CYBER WEEK SAVINGS

  • 0

    Days

  • 0

    Hours

  • 0

    Mints

  • 0

    Sec

GET OFFER

For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now