Remove the website field from comments
The comment form stops asking for a website address, which removes the reason many spammers comment. Links already on old comments stay.
<?php
add_filter(
'comment_form_default_fields',
static function ( $fields ) {
unset( $fields['url'] );
return $fields;
}
);
Good to know
Works with classic and block themes (the Comments Form block uses the same fields).
In these packs
- Comments: Fewer spam comments and more control: close old posts, set minimum and maximum lengths, a spam trap, no links.