Action Hook since 1.5.0
admin_menu
Fires before the admin menu is rendered — register menu pages here
Description
admin_menu is exclusively for add_menu_page() / add_submenu_page() calls; anything else belongs on admin_init.
When it runs
On every admin page load, after admin_init, before the admin screen renders.
Signature
do_action( 'admin_menu' );Examples
Basic
add_action( 'admin_menu', function() {
add_menu_page( 'My Plugin', 'My Plugin', 'manage_options', 'my-plugin', 'my_plugin_render_page', 'dashicons-admin-generic', 66 );
} );Register a top-level admin page.
Common Use Cases
- Register top-level or submenu admin pages
- Remove default menu items for non-admins
- Reorder menu items
Common mistakes
- Calling add_menu_page() on admin_init — the menu API isn't ready yet, so it silently does nothing
Related hooks
FAQ
Why doesn't my admin page show up?
add_menu_page() must be called on admin_menu, not admin_init or plugins_loaded — those run before the menu system is ready.
Source: wp-admin/menu.php