Magento 2 – How to Remove Menu Item in Admin Portal

adminhtmlmagento2menu

There are some menu items that are unnecessary for us. How can I remove them? Thanks.

Best Answer

By using remove tag you can remove a menu item from admin menu.

Syntax should be <remove id="MENU_ITEM_ID" />

Suppose I want to remove Cms page section from menu, then I have to rewrite below code at menu.xml of my module.

<?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>
    <remove id="Magento_Cms::cms_page" />
    </menu>
</config>

Magento_Cms::cms_page is menu id of cms page ,which is define at at vendor/magento/module-cms/etc/adminhtml/menu.xml .

Related Topic