Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

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.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Comments
  • Tested with WordPress 7.1
PHP
<?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.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.