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 site’s comment form. You can use the quick links below to jump straight to the method you want to use:
Method 1: Remove Website URL Field With Thrive Comments (Recommended)
The first method uses Thrive Comments, the best comment plugin for WordPress.
Besides preventing users from inserting spammy URLs, you can also use the plugin to boost your comment engagement. For example, you can allow users to like and dislike comments and even redirect commenters to a relevant post to increase your pageviews.
For more information, check out our full Thrive Themes review, where we talk more about Thrive Comments.
First, go to the Thrive Themes website to create a new account and get a paid plan.
Once signed up, simply go to the account dashboard.
Here, click the ‘Download and install the Thrive Product Manager plugin’ link.
At this stage, you can install the Thrive Product Manager plugin on your WordPress site. For more details, please see our guide on how to install a WordPress plugin.
Now, go to the Product Manager page from your WordPress admin area and click the ‘Log into my account’ button.
You should now see the Thrive Product Manager dashboard.
Here, just select Thrive Comments and click the ‘Install selected products’ button.
There should be a success message saying ‘Ready to use’ once the installation is done.
Now, just click the ‘Go to the Thrive Themes Dashboard’ button at the bottom.
On the next page, you will see all your installed plugins in the suite.
Click the ‘Thrive Comments’ button to start using the plugin.
On the Thrive Comments page, open the ‘Comment Sign-In’ menu.
Then, disable the ‘Allow guests to insert their website URLs’ setting.
This option will remove the website URL field from your WordPress website.
This way, your comment section will remain free of spam and your genuine commenters won’t accidentally click on malicious links.
That’s it. If you’re interested in using Thrive Comments to improve your comment section, here are other guides you can check out:
- How to Feature or Bury Comments in WordPress
- How to Allow Your Users to Subscribe to Comments in WordPress
- How to Allow Blog Users to Moderate Comments in WordPress
Method 2: Remove Website URL Field With a Free Plugin
If you want to remove the URL field from your WordPress comment form with a free plugin, then check out 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 Comment Tools » Comment Tools in the WordPress dashboard.
Here, check the box next to ‘Remove WEBSITE Field from Comment Form.’ This will discourage spammers from inserting their links.
That said, all the comments you previously approved will still contain a link. To remove these URLs, simply check the box next to ‘Remove hyperlink from comment AUTHOR Bio.’
We also recommend checking off the ‘Disable turning URLs into hyper-links in comments’ setting. This option prevents URLs in comments from being displayed as clickable hyperlinks.
Other than that, you can optionally enable the ‘Remove HTML Link Tags in comments’ option. This setting removes the HTML tags that create hyperlinks in comments. This ensures that any URLs or links in comments are not displayed as clickable links.
Once done, just 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.
Additionally, comment author names that used to have links will no longer have them, and users won’t be able to click on them anymore.
One of the tell-tale signs of this is that the text color of the comment author name that used to have links will be the same as the one that doesn’t.
Method 3: Remove Website URL Field With Code
Another option is to remove the website URL field using a code snippet.
The reason why we want to show you this method is that while the plugin can remove the URL field, it still keeps the “Save my name, email, and website in this browser for the next time I comment” checkbox at the bottom.
To keep things consistent, we want to change this text to “Save my name and email in this browser for the next time I comment.” And we can do that using custom code.
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.
Note: While a free WPCode plugin exists, we will use the premium version for this tutorial.
The first thing you need to do is install and activate the WPCode plugin on your website. For more details, see our step-by-step guide on how to install a WordPress plugin.
Adding Code to Remove the Website URL Field in the Comment Form
Upon activation, go to Code Snippets » Add Snippet.
Then, navigate to the ‘Comments’ tab and find the ‘Disable Comment Form Website URL’ snippet.
If you haven’t connected to the WPCode library yet, then you will now click on the ‘Connect to library to unlock (Free)’ button.
At this stage, simply log in to your WPCode account.
After that, just return to the previous WPCode plugin page. You will now see that the button has changed to ‘Use snippet.’ Click on it to use it.
You will now see the code snippet editor screen with the code to remove the website URL field from the comment form.
All you need to do now is just click on the ‘Inactive’ toggle so that it shows ‘Active’ instead. Then, click on ‘Update’ to make this snippet live.
Now, visitors can no longer add a website URL to their comments.
Adding Code to Remove Existing Links in Comment Author Names
The code from the previous step only removes the website URL field from the comment forms, but existing comments with linked author names will still have links.
Thankfully, you can easily remove them, too, with WPCode. What you need to do is go back to Code Snippets » Add Snippet. Then, click ‘Use snippet’ under ‘Add Your Custom Code (New Snippet).’
Now, you can give this code snippet a name to make it easily identifiable. It can be something simple like ‘Remove Hyperlinks in Comment Author Name.’
After that, change the Code Type to ‘PHP Snippet.’
Once done, copy and paste the following snippet in the Code Preview box:
function wpbeginner_remove_comment_author_link( $return, $author, $comment_ID ) {
// Simply return the comment author without the link
return $author;
}
// Hook the custom function into the 'get_comment_author_link' filter
add_filter( 'get_comment_author_link', 'wpbeginner_remove_comment_author_link', 10, 3 );
Scrolling down, make sure the Insert Method is ‘Auto Insert’ and the Location is ‘Run Everywhere.’
After that, just make the code active and click ‘Save Snippet.’
Now, you will no longer see the older comment author names have links in them.
Adding Code to Replace the Comments Cookies Opt-In Checkbox Text
If you choose to show the comments cookies opt-in checkbox in your comment form, then you will most likely see this checkbox text: “Save my name, email, and website in this browser for the next time I comment.”
Having this checkbox look like this when you no longer have the website URL field will seem pretty awkward. So, it’s a good idea to replace this text.
To do this, just create a new snippet like in the previous step and make the Code Type ‘PHP Snippet.’ You can name this code ‘Replace Comments Cookies Opt-In Checkbox Text.’
After that, copy and paste the code snippet below in the Code Preview box:
// Hook a custom function 'remove_website_from_checkbox_text' into the 'gettext' filter
add_filter('gettext', 'remove_website_from_checkbox_text');
function remove_website_from_checkbox_text($translated_text) {
// Replace the original text with the modified text
$translated_text = str_replace(
'Save my name, email, and website', // Original text to find
'Save my name and email', // Replacement text
$translated_text // The text being processed
);
// Return the modified translated text
return $translated_text;
}
You can make the Insert Method and Location settings the same as before.
Once you do that, just make the code active and click ‘Save Snippet.’
If the code is successful, then you should see the opt-in text changed to “Save my name and email in this browser for the next time I comment.”
Here’s what the opt-in text looks like on our test site:
We hope this article helped you learn how to remove the website URL field from the WordPress comment form. You may also want to see our beginner’s guide on how to moderate comments in 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
I don’t know, do it with the instruction, and some websites don’t work.
WPBeginner Support
If it does not work on a site, it likely means that the theme being used is overriding the default comment form.
Admin
Dipu
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
It should not be a major factor in your site’s SEO with either choice.
Admin
Tal
Thanks the php code works great!
WPBeginner Support
Glad it was able to help you!
Admin
osama
well done, and thank you for your great work
WPBeginner Support
You’re welcome, glad you found our guide helpful!
Admin