What menu positions and order are available in WordPress?
When you add a top level menu with add_menu_page(), the last parameter is the position. A lower number shows higher in the menu. The default positions are:
| Position | Menu item |
|---|---|
| 2 | Dashboard |
| 4 | Separator |
| 5 | Posts |
| 10 | Media |
| 15 | Links (hidden on new sites) |
| 20 | Pages |
| 25 | Comments |
| 59 | Separator |
| 60 | Appearance |
| 65 | Plugins |
| 70 | Users (or Profile) |
| 75 | Tools |
| 80 | Settings |
| 99 | Separator |
You can see them in the WordPress source file wp-admin/menu.php:
$ grep -n "^\$menu\[" wp-admin/menu.php | cut -c1-60
29:$menu[2] = array( __( 'Dashboard' ), 'read', 'index.php',
69:$menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-
73:$menu[10] = array( __( 'Media' ), 'upload_files', 'upload
89:$menu[15] = array( __( 'Links' ), 'manage_links', 'link-m
205:$menu[59] = array( '', 'read', 'separator2', '', 'wp-men
209:$menu[60] = array( __( 'Appearance' ), $appearance_capab
323:$menu[65] = array( sprintf( __( 'Plugins %s' ), $count )
390:$menu[75] = array( __( 'Tools' ), 'e
405:$menu[80] = array( __( 'Se
417:$menu[99] = array( '', 'read', 'separator-last', '', 'wp
add_action( 'admin_menu', function () {
add_menu_page( 'Reports', 'Reports', 'manage_options', 'my-reports', 'my_reports_page', 'dashicons-chart-bar', 26 );
} );
With position 26, the menu shows after Comments (25). Do not use the same number as another item: pick a decimal like 26.5 (as a string) to avoid an overwrite.
| Tutorials |
|---|
| WordPress Menus |
| WordPress Widgets |
| WordPress Register Nav Menus |
| Exercises & Assignments |
|---|
| Create a navigation menu with three links |
| Register a sidebar and show a widget in it |
| Interview Questions & Answers |
|---|
| What menu positions and order are available in WordPress? |
| What are widgets in WordPress? |