Skip to content

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

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.

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Comments
  • Tested with WordPress 7.1

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
<?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.

Move your snippets over this afternoon.

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