Get in Touch

Please enable JavaScript in your browser to complete this form.
Email

Disable All Comments on a WordPress Install

Time to Read:

1 minute
Scrabble letters spelling Feedback

There are various articles – to disable comments on WordPress.
If you are trying to disable it for a specific condition – this one is not for you.

If you want to disable “ALL” WordPress comments.

function disable_comment_2023(){
	wp_die(new WP_Error(403, 'Comments have been temporarily disabled on the site'));
}
//do not allow comments
add_action( 'pre_comment_on_post', 'disable_comment_2023' );

One response

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Posts

Filter