Disable comments

I’m wondering if there’s any way to prevent users from leaving comments but still display the comments form? So, whenever a new comment is posted, it should be automatically trashed or it shouldn’t be added at all.

The comment form I have is for presentational purposes only and it shouldn’t accept any comments but it should be displayed.

Read More

I’ve already found preprocess_comment and comment_post hooks but I’m out of ideas on how to utilize that to block commenting. I’m thinking about something like:

function prefix_delete_comments( $comment_id ) {
  wp_delete_comment( $comment_id, true );
}
add_action( 'comment_post', 'prefix_delete_comments');

but will this work or will it cause some errors in later execution?

Related posts

1 comment

Comments are closed.