How can I get rid of the URL field in the WordPress comment form?

How can I get rid of the URL field in the WordPress comment form?
It’s true that spammers flock to WordPress sites because they know how easy it is to build backlinks from them. The majority of bloggers have no idea how to deal with spam and don’t have the time to moderate each comment.

It’s worth noting that these spammers never use their real names and always leave a backlink to a site that isn’t necessarily relevant to yours.

Removing the “Website” or “URL” field entirely from your WordPress website is the best strategy to prevent spam.

Consider this: in most situations, the “Website” section is useless, as legitimate commenters are unlikely to own a website, and it just allows spammers to construct links to their sites. The more backlinks in your comments, the more outbound links your posts will have, which can hurt your SEO efforts.

We have two options for removing the website field from comments.
1. Disabling the Website field from comments using plugins

The WordPress repository has a number of plugins that eliminate the Website field from blog comments.

Installing Remove Fields or Remove Comment Website/URL Box is the simplest option.

Search for “Remove Fields” in WP-Admin -> Plugins -> Add New, then install and activate the plugin.

Activate the plugin when the installation process is complete to eliminate the Website field from blog comments.

This is a convenient way out for many. Some users, on the other hand, may opt to alter the WordPress files rather than employ more plugins on their WordPress website. Before making any modifications to the files, make a backup.

2. Removing the Website field from comments by editing the WordPress files
This strategy is only recommended for people who are comfortable modifying WordPress files and who keep meticulous records and backups of their WordPress sites.

Select functions.php from WP Admin -> Appearance -> Editor. (It’s sometimes called “Theme Functions.”)

EditFunctionsphp
Add the following code to the last line of functions.php: add filter(‘comment form default fields’, ‘website remove’); function website remove($fields) if(isset($fields[‘url’]) unset($fields[‘url’]); return $fields; if(isset($fields[‘url’]) unset($fields[‘url’]); return $fields

The code above produces the website remove() method, which removes (or unsets) the URL field.

We send the argument to the default WordPress function comment form default fields, which contains comment form fields, using the Hook add filter().

If you’re often getting comment link spam and don’t have a lot of time to check the comments, completely deleting the website field will deter link spammers.

Do you believe employing plugins or altering the core of your blog is a better strategy to combat URL spam?