How do you hide a default magento 2 config section in the backend (Admin Panel)? For example I want to hide the "Mail Sending Settings" section located in Stores->Configuration->Advanced->System

This is what I tried so far but it's not working:


"name": "vendor/module_name",
"description": "SMTP Extension for Magento 2 to help the configuration of the SMTP (Simple Mail Transfer Protocol) server.",
"type": "magento2-module",
"version": "1.0.0",
"require": {
    "php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
    "magento/framework": "100.1.*",
    "magento/magento-config": "100.1.*" 
"license": [
"minimum-stability": "stable",
"autoload": {
    "psr-4": {
        "Vendor\\Module_Name\\": ""
    "files": [





<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
        <section id="system">
            <group id="smtp" showInDefault="0" showInWebsite="0" showInStore="0">


<?xml version="1.0" encoding="utf-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="vendor_module_name" setup_version="1.0.0">

PS: My cache is disabled and my Magento 2 installation is in developer mode.

1 Answer 1


After some trials and errors I finally figured why it wasn't working. The file system.xml was misplaced into the wrong folder. system.xml needs to be placed under etc/adminhtml/system.xml and NOT under etc/system.xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.