Remove the Website field from the comment form and ignore any website address that's sent anyway, reducing personal data and link spam.
add_filter( 'comment_form_default_fields', function ( array $fields ): array {
unset( $fields['url'] );
return $fields;
} );
// Bots post the field even when it isn't on the form.
add_filter( 'preprocess_comment', function ( array $comment ): array {
if ( ! is_user_logged_in() ) {
$comment['comment_author_url'] = '';
}
return $comment;
} );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
The Website field collects data you probably don’t need, and it’s the main reason spam bots post comments: to get a link. Removing it cuts both.
comment_form_default_fields lists the fields shown to logged-out visitors. Removing url takes the Website box off the form.
Spam bots don’t use the form; they post straight to WordPress. preprocess_comment clears any website address from new comments by logged-out visitors, so links are never saved.
Log out and view a post. The comment form should have only Name, Email and Comment.