morganestes
5/15/2019 - 4:34 PM

Disable comments entirely from the WordPress backend

Disable comments entirely from the WordPress backend

<?php

add_filter( 'comments_open', '__return_false' );
add_action( 'admin_menu', function(){
	global $menu;

	// Remove Comments
	if ( isset( $menu[25] ) ) {
		unset( $menu[25] );
	}
}, 100 );
add_action( 'admin_bar_menu', function( $wp_admin_bar ) {
	$wp_admin_bar->remove_node( 'comments' );
}, 200 );