Only logged-in users can comment
Visitors must log in before they can comment. Useful for membership sites and shops where only customers should leave comments.
Before you switch it on: Nothing to fill in: it stays off after installing because visitors can no longer comment. Switch it on when you mean it.
It arrives switched off, even when you install its whole pack with "Switch on after installing".
<?php
// Same as Settings > Discussion > "Users must be registered and logged in to comment".
add_filter( 'pre_option_comment_registration', static fn() => 1 );
In these packs
- Comments: Fewer spam comments and more control: close old posts, set minimum and maximum lengths, a spam trap, no links.