WordPress Custom Menu


Default menu in wordpress are like Dashboard, Posts, Media, Comments, Plugins, etc. So, if we want to create a custom menu item of our own, we can can follow the following steps.

Code Snippet

add_action( "admin_menu", "custom_admin_menu" );

function custom_admin_menu(){


    __( "Custom Menu", "text domain" ),

    __( "Custom Menu", "text domain" ),

    'manage_options', // access restriction

    'custom-menu', // menu slug

    'custom_menu_callback_function', // callback function

    'dashicon', // image

    25 // menu order



    'custom-menu', // Parent menu slug

    __( "Custom Sub Menu", "text domain" ),

    __( "Custom Sub Menu", "text domain"),

    'manage_options', // access restriction

    'manage-submenu', // slug

    'custom_submenu_callback_function' // callback function



function custom_menu_callback_function(){
  // html template for menu goes here...

function custom_submenu_callback_function(){
  // html template for submenu goes here...


Still have any issue feel free to add a ticket and let us know your views to make the code better https://webkul.uvdesk.com/en/customer/create-ticket/

Thanks for Your Time! Have a Good Day!

. . .

Comments (2)

Add Your Comment

  • Ryan Gosling
    Great article!
    • Webkul Support
      Thank you.
  • css.php