s from the head. */ public function strip_feed_comment_links() { remove_action( 'wp_head', 'feed_links_extra', 3 ); } public function remove_admin_menu() { remove_menu_page( 'edit-comments.php' ); remove_submenu_page( 'options-general.php', 'options-discussion.php' ); } /** * Redirect the comments / discussion screens back to the dashboard. */ public function redirect_comment_screens() { global $pagenow; if ( in_array( $pagenow, [ 'edit-comments.php', 'options-discussion.php' ], true ) ) { wp_safe_redirect( admin_url() ); exit; } } public function remove_dashboard_widget() { remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); } /** * @param \WP_Admin_Bar $wp_admin_bar */ public function remove_admin_bar_node( $wp_admin_bar ) { if ( is_object( $wp_admin_bar ) && method_exists( $wp_admin_bar, 'remove_node' ) ) { $wp_admin_bar->remove_node( 'comments' ); } } }