How to remove website URL field from WordPress comment

As a WordPress site owner, you may have noticed that by default the WordPress comment form has name, email, comment & website URL field. However, you may not want to display the website field to visitors, especially if you’re concerned about spam comments and links to suspicious sites. Fortunately, the customization facility of WordPress allows you to remove the website field from the comments section using either a plugin or some code.

In this article, we will explain how to remove the website field from WordPress comments in two ways: using a plugin and without using a plugin.

Why remove website URL field from WordPress comments?

Many spammers take WordPress comments as a way to spam and flood links to other websites. By removing website (URL) field from WordPress comments we will be demotivating spammers and limiting the number of spam comments in our WordPress website.

WordPress comment form.
Fig: WordPress default comment box with website (URL) field.

Method 1: Using a Plugin

Using a plugin is the easiest way to remove the website field from WordPress comments. There are many plugins available in the WordPress repository that can help you achieve this. In this tutorial, we will use the “URL Field Remover From Comment Box” plugin, which is free and widely used.

Install and activate the “URL Field Remover From Comment Box” plugin from the WordPress repository. If you do not know how to install a plugin you may want to follow our detailed guide on installing WordPress plugins.

After you install the plugin you need to activate it. Once activated, the plugin will remove the website URL field from WordPress comments. In case you want to disable the functionality you can do it by going to the “URL Remover” from WordPress menu and uncheck the “URL Field Remover” button and click on “Save Changes”.

Website (URL) field removed from the WordPress comments
Fig: Website (URL) field removed from the WordPress comments after using the plugin.

Method 2: Without Using a Plugin

If you prefer not to use a plugin, you can also remove the website field from WordPress comments using some code. Here are the steps to follow:

Log in to your WordPress dashboard and go to Appearance >> Theme Editor.

On the right-hand side of the Theme Editor, you’ll see a list of files under “Theme Files.” Look for the “functions.php” file and click on it.

Add the following code to the bottom of the functions.php file:

add_action( 'after_setup_theme', 'wptracer_commentbox_add_comment_url_filter' );
function wptracer_commentbox_add_comment_url_filter() {
    add_filter( 'comment_form_default_fields', 'wptracer_commentbox_disable_comment_url', 20 );
}

function wptracer_commentbox_disable_comment_url($fields) {
    unset($fields['url']);
    return $fields;
}

Save the changes to your functions.php file by clicking on the “Update File” button.

By following the above steps, you have successfully removed the website field from WordPress comments.

Wrapping Up

Removing the website field from WordPress comments is an effective way to reduce spam comments and suspicious links. As we have shown in this article, you can achieve this by using a plugin or some code. Choose the method that best suits your needs and follow the steps outlined above. If you have any further questions regarding the topic, you can ask us on the comment sections.

More Resources for you:

Leave a Comment