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

Group wizard

One session: this hook, then each related_hooks entry. Walk it and tell us what to change.

admin_menu → admin_init

functions.php — admin_menu
functions.php
PHP admin_menu · Hook 1 of 2 · Step 1 of 6

Practice the admin_menu WordPress action hook in our interactive sandbox — a VS Code-style editor with a step-by-step admin_menu tutorial, add_action exercises, and instant feedback. No local WordPress install required.