How to Add a Third Level Sub Menu to the WordPress Admin Menu

No, it is not possible to create third level menu in admin panel. If you look at the definition of add_submenu_page, you need to mention the parent slug name. For eg:

add_menu_page ( 'Test Menu', 'Test Menu', 'read', 'testmainmenu', '', '' );
add_submenu_page ( 'testmainmenu', 'Test Menu', 'Child1', 'read', 'child1', '');

The first parameter of the add_submenu_page will be parent slug name. So you may think we can write child1 as parent slug name to create the third level. Eg:

add_submenu_page ( 'child1', 'Test Menu', 'Child2', 'read', 'child2', '');

But this will not work. Look at the parameters definition and source section in this link. It clearly states that, you can only use the name of ‘main menu of the plugin‘ or the file name of the WordPress plugin in parent slug name. So it is not possible to create submenus more than once in admin panel. However, you can create n number of sub menus in front end. To know more about creating menus and sub menus in front end, refer

Leave a Comment