Magento – Magento 2.2.2 – Remove default welcome message and show username post login

customerheaderlayoutmagento2xml

I need to remove default welcome message from header but display username after successful login. Tried below to hide welcome message but it also removes username
after login

<referenceBlock name="header">
    <arguments>
        <argument name="show_part" xsi:type="string">other</argument>
    </arguments>
</referenceBlock>

Also tried below

<referenceBlock name="top.links">
   <referenceBlock name="header" remove="true"/>  
</referenceBlock>

How do I achieve above using xml and without overriding template file ?

Best Answer

  1. On the Admin menu, go Content > Design > Configuration > Select your current theme > .
  2. Choose the storeview you want to remove the welcome message.
  3. Under Action column, open the Edit mode. Scroll down and expand
    the Header section.
  4. Then, remove the Welcome Text.