remove_menu( 'comments' ); } public static function unregister_widget(): void { unregister_widget( 'WP_Widget_Recent_Comments' ); } public static function remove_dashboard_widget(): void { remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); } public static function redirect_comments_page(): void { global $pagenow; if ( 'edit-comments.php' === $pagenow ) { wp_safe_redirect( admin_url() ); exit; } } }