Magento Tutorials

How to Create Admin Menu in Magento 2

Hello Magento Friends,

Today I am going to throw light on How to Create Admin Menu in Magento 2.

Magento is at a leading place when it comes to customization. You can customize every bit of the website if you are working with Magento. Magento admin has various menu options that are useful to perform configuration settings on the store frontend. The menu options have submenus and the submenu have further other submenus. You can create your own custom menu on the admin sidebar of your Magento 2 store.

Follow the steps below to Create Admin Menu in Magento 2.

Steps to Create Admin Menu in Magento 2:

Step 1: Create an admin menu file named menu.xml file at the following path

app\code\Vendor\Extension\etc\adminhtml\menu.xml

Now add the below code

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Vendor_Extension::custom_menu" title="Custom Menu" module="Vendor_Extension" sortOrder="50" resource="Vendor_Extension::custom_menu"/>
        <add id="Vendor_Extension::notifications" title="Notifications" module="Vendor_Extension" sortOrder="10" action="vendorextension/notifications" resource="Vendor_Extension::notifications" parent="Vendor_Extension::custom_menu"/>
        <add id="Vendor_Extension::configuration" title="Configurations" module="Vendor_Extension" sortOrder="100" parent="Vendor_Extension::custom_menu" action="adminhtml/system_config/edit/section/custom_menu" resource="Vendor_Extension::configuration"/>
    </menu>
</config>

Checkout from your Magento Admin. A custom menu will be created as shown in the below image.

Conclusion:

Hence, accordingly, you can successfully Create Admin Menu in Magento 2. Alternatively, you can also Hide Admin Menu in Magento 2. If you have any doubts let me know via the comment box without any hesitation. Share the article with your friends and stay in touch!

Happy Reading!

Click to rate this post!
[Total: 6 Average: 5]
Dhiren Vasoya

Dhiren Vasoya is a Director and Co-founder at MageComp, Passionate ?️ Certified Magento Developer?‍?. He has more than 9 years of experience in Magento Development and completed 850+ projects to solve the most important E-commerce challenges. He is fond❤️ of coding and if he is not busy developing then you can find him at the cricket ground, hitting boundaries.?

View Comments

  • Dear Dhiren,
    Your article is very useful for me to understand and create a customised menu in magento. I have another request from customer, they hope create menu with header which is similar with magento stores menu:
    Settings
    All Stores
    Configuration
    Terms and Conditions
    Order Status
    then we can add our customised menu items under the header. Is there any way to implement it?
    Many thanks!

Recent Posts

Generating Thumbnails with Spatie Media Library in Laravel 11: A Step-by-Step Guide

Generating image thumbnails is a common requirement in web applications, especially when handling media-heavy content.…

5 hours ago

Enhancing Web Application Security with Laravel’s Built-In Features

In today’s digital landscape, web application security is paramount. As a powerful PHP framework, Laravel…

1 day ago

Magento 2 Extensions Digest October 2024 (New Release & Updates)

October was an exciting month for MageComp! From significant updates across our Magento 2 extension…

1 day ago

Improving Error Handling and Transition Management in Remix with useRouteError and useViewTransitionState

In modern web development, seamless navigation and state management are crucial for delivering a smooth…

1 week ago

Magento Open Source 2.4.8-Beta Release Notes

Magento Open Source 2.4.8 beta version released on October  8, 2024. The latest release of…

1 week ago

How to Create Catalog Price Rule in Magento 2 Programmatically?

Hello Magento Friends, Creating catalog price rules programmatically in Magento 2 can be a valuable…

1 week ago