Home » Disable All Comments on a WordPress Install

Disable All Comments on a WordPress Install

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' );

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.

Filter