0

How to disable Welcome message in magento 2.3

1

Go to

magento2/vendor/magento/module-theme/view/frontend/templates/html/header.phtml

and remove the <li> tag marked in the picture below.

enter image description here

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:

enter image description here

But, this will still display the username if customer is loggedin.

0

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

6
  • Hi Pratik. I am using custom theme and want to remove only welcome admin. Please ket me know which option i can use? – gill Aug 21 '20 at 6:44
  • So you want to remove welcome message for both Guest and Login user right? – Pratik Oza Aug 21 '20 at 6:46
  • Yes, for both user – gill Aug 21 '20 at 10:05
  • You can implement "Option 2" OR "Option 4" – Pratik Oza Aug 21 '20 at 10:55
  • I tried Option 2 but not working. – gill Aug 21 '20 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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