Do you want to remove the website URL field from your WordPress comment form?
Many bots and spammers use this field to get backlinks to their sites. By removing the ‘Website’ field, you can immediately make your site less attractive to spammers.
In this article, we will show you how to remove the website URL field from the WordPress comment form.
Why Do People Submit Spam Comments?
Since most spam is generated by automated bots, you can easily combat comment spam using free tools and plugins. However, it’s much more difficult to stop spam comments that are submitted by people.
These comments are often off-topic, irrelevant, and add no value to the conversation.
When it shows comments, WordPress automatically links the person’s username with the website URL they provided. Spammers may use this field to get backlinks or to try and get better rankings for specific keywords.
By removing the website URL field, you can discourage spammers from posting on your WordPress blog or website.
Genuine users will leave a comment no matter whether they get a backlink or not, so this shouldn’t impact how many quality comments you get.
That being said, let’s take a look at how to easily remove the website field from your WordPress comment form. You can use the quick links below to jump straight to the method you want to use.
Method 1: Remove Website Field Using a Free Plugin (Easy)
The easiest way to remove the URL field from your WordPress comment form is by using Comment Link Remove and Comment Tools. This plugin lets you remove the field and also delete any links from comments you have already approved.
First, you need to install and activate the Comment Link Remove and Comment Tools plugin. For detailed instructions, see our guide on how to install a WordPress plugin.
Upon activation, click on QC CLR Settings in the WordPress dashboard.
Here, check the box next to ‘Remove WEBSITE Field from Comment Form.’
After that, simply scroll to the bottom of the page and click on the ‘Save Changes’ button to store your settings.
To see this change in action, either log out of your account or visit your website in an incognito tab. You will see the comment form no longer has a website URL field.
This will discourage spammers, but all the comments you previously approved will still contain a link.
To remove these URLs, simply go to QC CLR Settings in the WordPress dashboard. Then, check the box next to ‘Remove hyperlink from comment AUTHOR Bio.’
Simply save your changes, and WordPress will remove all the links from comments you previously approved.
Method 2: Remove the Website URL Field From WordPress Comments Using Code
Another option is to remove the website URL field using a code snippet. Often, tutorials will tell you to add custom code snippets to your theme’s functions.php file.
However, we don’t recommend this because even a small mistake in your code could cause a number of common WordPress errors, or even break your site completely.
That’s why we recommend using WPCode. It is the easiest and safest way to add custom code in WordPress without having to edit any core theme files.
The first thing you need to do is install and activate the free WPCode plugin on your website. For more details, see our step-by-step guide on how to install a WordPress plugin.
Upon activation, go to Code Snippets » Add Snippet.
Here, you will see all the different ready-made snippets that you can add to your site. These include snippets that allow you to completely disable comments in WordPress, disable automatic updates, and more.
To create your own snippet, hover your mouse over ‘Add Your Custom Code,’ and then click ‘Use snippet.’
To start, enter a title for the custom code snippet. This can be anything that helps you identify the snippet in your WordPress dashboard.
After that, open the ‘Code Type’ dropdown and select ‘PHP Snippet.’
Once you’ve done that, simply paste the following snippet into the code editor:
add_filter('comment_form_default_fields', 'unset_url_field');
function unset_url_field($fields){
if(isset($fields['url']))
unset($fields['url']);
return $fields;
}
After that, scroll to the ‘Insertion’ section. If it isn’t already selected, then choose the ‘Auto Insert’ method, as this will insert and execute the snippet across your website.
Next, open the ‘Location’ dropdown and click on ‘Run Everywhere.’
With that done, scroll to the top of the screen and click on the ‘Inactive’ toggle so that it shows ‘Active’ instead.
Finally, click on ‘Save Snippet’ to make this snippet live.
Now, visitors can no longer add a website URL to their comments.
We hope this article helped you to learn how to remove the website URL field from the WordPress comment form. You may also want to see our guide on how to make money online blogging with WordPress and our expert picks for the best contact form plugins.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Leslie says
I don’t know, do it with the instruction, and some websites don’t work.
WPBeginner Support says
If it does not work on a site, it likely means that the theme being used is overriding the default comment form.
Admin
Dipu says
Hello, thank you for creating a valuable blog post as it was a question of many about how to remove the website field from the comment form.
I want to know that if allowed the website filed, is it helpful for SEO, because they are nofollow links?
WPBeginner Support says
It should not be a major factor in your site’s SEO with either choice.
Admin
Tal says
Thanks the php code works great!
WPBeginner Support says
Glad it was able to help you!
Admin
osama says
well done, and thank you for your great work
WPBeginner Support says
You’re welcome, glad you found our guide helpful!
Admin