Back to Top

Update or Remove Existing Menu – Magento2

Updated 8 November 2016

Here we will see how to update or remove any existing menu in magento admin in magento2.

First create menu.xml file in your module.
In this file remove or update menu by its id.

Update Existing Menu

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <update id="Magento_Sales::sales_order" title="My Orders" action="demo/demo/demo"/>
    </menu>
</config>

Here i updated order menu title to “My Orders” and its action to “demo/demo/demo”.
In this way you can update any existing menu. id=”Magento_Sales::sales_order”. You will find id in sales module’s menu.xml file.

Existing Menu
Existing Menu

Remove Menu

Now if you want to remove any menu or menu item, use following code.

Searching for an experienced
Magento 2 Company ?
Find out More
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <remove id="Magento_Sales::sales_invoice" />
        <remove id="Magento_Sales::sales_shipment" />
        <remove id="Magento_Sales::sales_creditmemo" />
    </menu>
</config>

Here i removed Invoice, Shipment and Creditmemo menu from Sales menu.
Existing Menu

That’s All.
If you have any query or issue, comment below.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home