How To Change Default Admin Logo In Magento 2
In this post, I will guide you on How To Change Default Admin Logo In Magento 2. Changing the default Magento logo to your brand logo is the best way to assert your brand in the e-commerce market. You can also change them in Magento Admin Panel.
Change Default Admin Logo In Magento 2
Admin Login Page
1. Upload your logo design follow the below path:
vendor\magento\theme-adminhtml-backend\web\images\{your-image-name}.png
2. Create admin_login.xml file in the following path:
app\code\{your-Vendor}\{your-Extension}\view\adminhtml\layout\admin_login.xml
And add the following code:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_image_src" xsi:type="string">images/{your-image-name}.png</argument>
</arguments>
</referenceBlock>
</body>
</page>
For example:
I upload image magetop-logo-admin-login.png follow the path as instructed in step one.
Next, I create admin_login.xml and add below code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-login" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="logo">
<arguments>
<argument name="logo_image_src" xsi:type="string">images/magetop-logo-admin-login.png</argument>
</arguments>
</referenceBlock>
</body>
</page>
Then, run deploy static content, flush cache command and see the result:
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Admin Menu Sidebar
1. Upload your image follow the below path:
vendor\magento\theme-adminhtml-backend\web\images\{your-image-name}.png
2. Create default.xml file in the following path:
app\code\{your-Vendor}\{your-Extension}\view\adminhtml\layout\default.xml
And add the following code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header">
<block class="Magento\Backend\Block\Page\Header" name="logo" before="-">
<arguments>
<argument name="show_part" xsi:type="string">logo</argument>
<argument name="edition" translate="true" xsi:type="string">Community Edition</argument>
<argument name="logo_image_src" xsi:type="string">images/{your-image-name}.png</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
For example:
I upload image magetop-logo.png follow the path as instructed in step one.
Next, I create default.xml and add below code:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header">
<block class="Magento\Backend\Block\Page\Header" name="logo" before="-">
<arguments>
<argument name="show_part" xsi:type="string">logo</argument>
<argument name="edition" translate="true" xsi:type="string">Community Edition</argument>
<argument name="logo_image_src" xsi:type="string">images/magetop-logo.png</argument>
</arguments>
</block>
</referenceContainer>
</body>
</page>
Then, run deploy static content, flush cache command and see the result:
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Follow us for the more helpful posts!
We hope this is a useful post for you.
You can read more useful posts like How To Unlock Admin User In Magento 2.
Thank you for reading!