How to remove the Comments section from the WordPress Admin

WordPress
PHP

  • Dani Dean
  • 29th Apr 2022

When developing a WordPress website I like to remove any unneccesary functions and options from the Admin to keep it as clean and tidy as possible for the client.

To remove the Comments section all you need to do is add the following snippet of code into the active theme's functions.php file.

// Remove Comments in CMS
function pk_remove_admin_menus() {
  remove_menu_page( 'edit-comments.php' );
}
add_action( 'admin_menu', 'pk_remove_admin_menus' );
Back to Blogs