Remove unwanted WordPress menu items

When creating WordPress websites for clients I like to remove features that will not be used to prevent confusion and questions. For example, allot of WordPress website I create do not contain a blog and therefore have no ‘Posts’ menu item.

Removing a menu item is easy, if you for example would like to remove the ‘Posts’ menu item you simply add the following code to your project (for example to your theme’s functions.php).

add_action('admin_menu', 'remove_options');

function remove_options() {
	remove_menu_page( 'edit.php' );

You can delete any admin menu item this way, all you need to do is add the php file as argument to the ‘remove_menu_page’ function. So if you delete the ‘Posts’ menu item like I did in the example above you most likely also want to delete the menu item ‘Comments’. Following code will remove both.

add_action('admin_menu', 'remove_options');

function remove_options() {
	remove_menu_page( 'edit.php' );
	remove_menu_page( 'edit-comments.php' );

Please note that the ‘remove_menu_page’ function does not disable or restrict access to the removed page, it only removes the menu item. In many cases this will do, but always keep security in mind.

Related Posts

Powered By Related Posts for WordPress
Click Here to Learn More About Related Posts for WordPress

7 thoughts on “Remove unwanted WordPress menu items

  1. Sir How to delete newsletter Tab created in Menu Bar ?

  2. How to remove Archives, Author,Tags and others unwanted URLS?

  3. Really, brother, it’s working for me thanks for sharing and brief info… appreciated

  4. Hiii sir !!
    Really working tips thanks for sharing
    Best regards : Gud morning shayari

  5. i was looking for this thanks

  6. This article helps me a lot. I was looking for this one.

  7. Very informative article for me. These wordpress plugins are very helful for sure.

Leave a Reply

Your email address will not be published. Required fields are marked *