cancel
Showing results for 
Search instead for 
Did you mean: 

How to Remove "Logo" Block from Magento_Catalog's Initial Landing Page?

How to Remove "Logo" Block from Magento_Catalog's Initial Landing Page?

In my Magento 2 (CE ver. 2.4.7) custom theme's Magento_Catalog module's initial landing page, there's a block positioned in the header area called "logo" (this is the block that creates and positions the default Magento logo image). I'm struggling with how to remove the logo block from this Magento_Catalog page. (Note my custom theme's parent is the default "blank" theme).


Now, I traced the inheritance source for the logo block back to Magento 2's base Magento_Theme module. You can see the key section below for this initial block definition in the file : /magento2/vendor/magento/module-theme/view/frontend/layout/default.xml :

 

<container name="header-wrapper" label="Page Header" as="header-wrapper" htmlTag="div" htmlClass="header content"> <block class="Magento\Theme\Block\Html\Header\Logo" name="logo"> 
<arguments> <argument name="logoPathResolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoPathResolver</argument> <argument name="logo\size\resolver" xsi:type="object">Magento\Theme\ViewModel\Block\Html\Header\LogoSizeResolver</argument> </arguments>
</block>
</container>

 

Initially, I tried to remove this logo block with a "referenceBlock name="logo" remove="true" " statement in each of my custom theme's Magento_Catalog's two main layout files (default.xml, and then catalog_category_view.xml ) -- but neither approached worked: the logo block and image remained on the page.


And so in response, because this block was initially created in the default.xml page of the /magento2/vendor/magento/module-theme/view/frontend/layout folder, I instead turned to creating a new default.xml file in my custom theme's Magento_Theme/layout folder (and then added to that file the declaration:

<referenceBlock name="logo" remove="true" ... </referenceBlock> 

-- but that also did not work. After always doing a cache:clean and redeploy of static content, on page refresh, the image (and its block) remained on the page.


And so instead, in the same file, I tried removing the container element wrapping that logo block ("header.wrapper") -- but that also didn't work. And so despite all the efforts that I believe were well guided, the default Magento logo remains in the header section of my custom theme's Magento_Catalog's initial landing page.


What did I do wrong? Why was this removal of the logo block not successful?  What else can I do?