How to disable Welcome message in magento 2.3
2 Answers
Go to
magento2/vendor/magento/module-theme/view/frontend/templates/html/header.phtml
and remove the <li>
tag marked in the picture below.
If using any custom theme, you may find the relevant file in app/design/theme directory and modify code in that file.
Run upgrade and cache commands, and you're good to go.
Also you can remove the message from admin panel as shown from below location:
But, this will still display the username if customer is loggedin.
Option 1: If you want to disable welcome message only for the guest user:
Admin sidebar > Content > Design > Configuration > EDIT current theme(Store View) > Header > Welcome Text(Remove text)
Option 2: To keep the header intact and just hide the welcome message:
<your_vendor_name>/<your_theme_name>/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="header">
<arguments>
<argument name="show_part" xsi:type="string">other</argument>
</arguments>
</referenceBlock>
</body>
</page>
Option 3: To completely remove the header.phtml
<your_vendor_name>/<your_theme_name>/Magento_Theme/layout/default.xml
<?xml version="1.0"?>
<page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="top.links">
<referenceBlock name="header" remove="true"/>
</referenceBlock>
</body>
</page>
Option 4: To customize structure based on requirement, override header.phtml file into your theme folder. Copy file from the following path and put into your theme folder:
From:
vendor/magento/module-theme/view/frontend/templates/html/header.phtml
To:
<your_vendor_name>/<your_theme_name>/Magento_Theme/templates/html/header.phtml
Note: To create a storefront theme, refer to the link
-
Hi Pratik. I am using custom theme and want to remove only welcome admin. Please ket me know which option i can use?– gillCommented Aug 21, 2020 at 6:44
-
So you want to remove welcome message for both Guest and Login user right? Commented Aug 21, 2020 at 6:46
-
-
-