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

21 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. i was looking for this thanks

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

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

  7. Sir this information is very helpful for me thankyou for a sharing

  8. I requested WooCommerce to change their setup, so it is possible to manage authorisations for their part of the menu. The idea needs votes on https://ideas.woocommerce.com/forums/133476-woocommerce/suggestions/39069922-woocommerce-should-not-reveal-an-overview-of-all-p Please give it your maximum 3 points, thanks!

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

  10. Thanks, Bro… for sharing this knowledge with us. it’s very useful for me. thanks.

  11. thank you for share… it’s working on my WordPress website.

  12. today i learn something new, Thank you so much for this valuable content. .

  13. Bro itss working amazing thankss for sharing

  14. thanks for nice article

  15. Nice method for quickly removing unwanted WordPress menu items!

  16. nice method i was searching for this method for so long

  17. Very Informative article. Thank you so much for sharing.

  18. Nice post bro ??

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

  20. Hi,

    Really Helpful post actually…..!!

  21. Thanks for sharing this informative content with us.

Leave a Reply

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