Tutsflow

How to Remove Website URL Field from the WordPress Comment Form

Today in this post we will discuss about how to remove the WordPress website URL field from the comment form to stop and control spam comments.

Most websites owner do not know how to control spam and they do not have the time to moderate each comment. It’s necessary to block spammers building backlinks off from them.

A list of spam blog comments generally looks like this:

Did you detect that these spammers do not use their actual name and always leave a backlink to a website, which in most subjects may not be associated with your website? The ideal way to prevent spam is to remove the “Website” or “URL” field completely from your WordPress website.

Default WordPress comment form

There are two ways to remove the website URL field from the comment form:

1. Using Plugins

There are several plugins available in the WordPress repository but the simple ways to use and install Remove Fields or Remove Comment Website/URL Box.

After it, the successfully installed, activate the plugin to remove the site URL field from blog comments.

2. Using the Code Snippet

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

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

If You are a beginner in WordPress and you don’t how to put it then a simple way is to use Code Snippets Plugin. After activating the plugin on your website, add a new snippet.

Insert the title of the snippet and copy and paste the above code, then save and activate it.

After activating it, check the final output of the site in incognito window mode on your web browser.

The final output

What do you consider is the more useful way of tackling URL spam on your site: using plugins or editing the core? Let us share your views on this issue in the comments section below. – At last goodbye spam comments! 😉

Share the Post:

Featured WordPress Plugins

PatternsWP

WordPress Block Patterns Library

Deals & Coupons

Unbounce Coupon

Save 20% off first 3 months

Cloudways Coupon

Save 20% off first 1 months