Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

How to Remove Website URL Field From WordPress Comment Form

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

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.

Removing website URL field from 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.

The default WordPress comment form

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

Comment Link Remove and Comment Tools plugin

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

After that, just scroll to the bottom of the page and click on the ‘Save Changes’ button to store your settings.

Saving the changes made with the Comment Link Remove plugin

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.

Comment form without 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.

Example of comment author names that don't have links

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.

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.

How to add a code snippet to WordPress

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.

Clicking 'Use snippet' in the Disable Comment Form Website URL code snippet in WPCode

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.

Activating the Disable Website URL Comment Form code snippet in WPCode

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

Adding custom code in WPCode

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

Creating a code snippet in WPCode to remove hyperlinks in existing comment author names

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

Choosing the insertion method and location in WPCode

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:

Save my name and email in this browser for the next time I comment checkbox text

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

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

105 CommentsLeave a Reply

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

    • 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

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

Leave a Reply to yellowans Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WPBeginner Assistant
How can I help you?

By chatting, you consent to this chat being stored according to our privacy policy and your email will be added to receive weekly WordPress tutorials from WPBeginner.