Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove comments links from admin bar and admin menu
/*
Title: Hide Comments Menu
Type: PHP > Custom Code
Location: Init
Priority: 10
*/
// Remove comments from admin bar
add_action('wp_before_admin_bar_render', function () {
global $wp_admin_bar;
$wp_admin_bar->remove_node('comments');
});
// Remove comments from admin menu
add_action('admin_menu', function () {
remove_menu_page('edit-comments.php');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment