By removing the website field from the WordPress comment form, you’ll prevent people from leaving manual spam comments, and also avoid ending up with a lot of broken links on your website.

Cloudways

Recently, I’ve checked my website for broken links using Dead Link Checker, and I’ve noticed a lot of broken links coming from the website fields of the WordPress comments section.

broken links wordpress comments

There were a lot more than these!

Cloudways

The thing is that there are a lot of websites created every day, but a huge amount of them drop like flies, mainly because people find out that having a website isn’t as easy as it sounds, and they won’t make money overnight as well.

They create a website, then desperately try to promote it, and some include spamming comments as part of their strategy, unfortunately.

They think they’ll get more traffic and exposure, and perhaps a backlink as well.

Cloudways

The reality is that they won’t get anything, but you’ll end up with spam and a lot of broken links after they give up on their websites.

We all know that spam is bad, but what about broken links? Well, they’re pretty bad too, for both user experience and SEO.

So, in this post, I’ll show you how to remove the website field from the WordPress comment form, to further fight spam and prevent broken links.

And no, we’re not going to use a plugin for something simple like this. We’re going to get our hands dirty!

Cloudways

Always keep in mind: The fewer plugins you have, the better!

I don’t think there’s a plugin for this anyway, at least not one that isn’t outdated for years.

Remove the website field from WordPress comments

I recommend having a child theme in place for this, otherwise, the changes will go away with the next update! An alternative would be using the Code Snippets plugin. I also recommend backing up the file or the whole website!

Step 1 – You’ll need to access your WordPress theme’s files and edit your functions.php file.

You’ll normally find your child theme’s function.php file in /public_html/wp-content/themes/YOURTHEME-child/functions.php or /public_html/YOURDOMAIN.COM/wp-content/themes/YOURTHEME-child/functions.php, if you want to access an add-on domain’s files.

edit WordPress functions.php cpanel

Editing functions.php via cPanel

Step 2 – Once you’ve opened the file for editing, add the below code right at the very bottom or before ?>, if it has any.

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

Don’t forget to save the file!

remove website field wordpress comment form

Now your website field should be removed from the WordPress comment form.

If you don’t see the change after a simple refresh, clear your browser and website cache.

Note that this only works if you use the default commenting system from WordPress!

That’s a wrap

Hope you found the post comprehensive, and you’ve managed to remove the website field from your WordPress comments.

If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.

You can also hit the follow button on Twitter and subscribe to the YouTube channel.

If you want to start your own WordPress blog, or need a website for your business, ThemeSkills’ WordPress website service is at your disposal! On-going WordPress support and maintenance is on the menu as well!

You can also purchase a ready-made WordPress website with hosting and support included!