Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Disable comments entirely from the WordPress backend
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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.