---
title: "How to Hide Admin Menu Based on System Config in Magento 2"
url: "https://magecomp.com/blog/hide-admin-menu-based-on-system-config-magento-2/"
date: "2021-07-31T11:26:43+00:00"
modified: "2025-02-19T05:55:23+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 194
reading_time: "1 min read"
summary: "Hello Magento Friends,"
description: "When the extension is disabled in the system, it should be also hidden from the admin menu. Learn How to Hide Admin Menu Based on System Config in Magento 2"
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Add Custom Product Attribute Programmatically using Data Patch in Magento 2?"
    url: "https://magecomp.com/blog/add-custom-product-attribute-programmatically-using-data-patch-magento-2/"
  - title: "Best Magento 2 Marketplace Extensions"
    url: "https://magecomp.com/blog/best-magento-2-marketplace-extensions/"
  - title: "How to Use Built-In jQuery Library in Magento 2"
    url: "https://magecomp.com/blog/how-to-use-built-in-jquery-library-in-magento-2/"
---

# How to Hide Admin Menu Based on System Config in Magento 2

_Published: July 31, 2021_  
_Author: Dhiren Vasoya_  

![How to Hide Admin Menu Based on System Config in Magento 2](https://magecomp.com/blog/wp-content/uploads/2021/07/How-to-Hide-Admin-Menu-Based-on-System-Config-in-Magento-2-1024x512.webp)

**Hello Magento Friends,**

Today we will learn about How to Hide Admin Menu Based on System Config in Magento 2.
[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-4.webp)](https://magecomp.com/services/hire-magento-programmer/)

In Magento 2, a menu of any particular extension is displayed in the admin panel menubar. But when you disable the extension from the system configuration, it should also be hidden from the admin menu. To accomplish this, you need to follow the below steps.
## Steps to Hide Admin Menu Based on System Config in Magento 2:
**Step 1:** Add a file at the below path
**app\code\Vendor\Extension\etc\adminhtml\menu.xml**

```
<?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::extensionmenu" title=" Extension Menu" module="Vendor_Extension" sortOrder="10" resource="Vendor_Extension::mainmenu" dependsOnConfig="section/group/field"/>
    </menu>
</config>
```

That’s it!
[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-5.webp)](https://magecomp.com/magento-malware-removal.html)

## Conclusion:
Accordingly, you can Hide Admin Menu Based on System Config in Magento 2. In case of any difficulty, let me know via the comment box. I will be happy to solve it! Do share the article with your friends and stay updated with us.
[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-2.webp)](https://magecomp.com/magento-performance-optimization.html)

**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/hide-admin-menu-based-on-system-config-magento-2/](https://magecomp.com/blog/hide-admin-menu-based-on-system-config-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-19 12:09:24 UTC_  
