Skip to content

Instantly share code, notes, and snippets.

@robgolbeck
Last active August 29, 2015 14:19
Show Gist options
  • Save robgolbeck/9b3d69690361c98184d4 to your computer and use it in GitHub Desktop.
Save robgolbeck/9b3d69690361c98184d4 to your computer and use it in GitHub Desktop.
Function to remove unused items from the WordPress admin menu
<?php
// Remove unused items from the admin menu
// Reference: https://codex.wordpress.org/Function_Reference/remove_menu_page
function remove_menus(){
remove_menu_page( 'edit.php' ); // Posts
remove_menu_page( 'edit-comments.php' ); //Comments
}
add_action( 'admin_menu', 'remove_menus' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment