I am messing with an issue in Magento 2 site. I have to remove breadcrumbs from the category page. I have also to remove the toolbar from the same page.
Add below code to remove breadcrumbs from category pages
app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_category_view.xml
<referenceBlock name="breadcrumbs" remove="true" />
For remove toolbar
<referenceBlock name="product_list_toolbar" display="false" />
Remove var/cache and var/page_cache folder.
Thank you for the information this was helpful. For Magento 2.2.5 use the code below
<referenceContainer name="breadcrumbs" remove="true" />
Add below code to remove breadcrumbs from category pages
app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_category_view.xml
<referenceBlock name="breadcrumbs" remove="true" />
And for removing toolbar, Comment out below line form list.phtml
app/design/frontend/Vendor/Theme/Magento_Catalog/templates/product/list.phtml
the 2 lines with
<?php echo $block->getToolbarHtml() ?>
Navigate to
app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_category_view.xml
and put below code in <body>
tag
<referenceBlock name="breadcrumbs" remove="true" />
<referenceBlock name="product_list_toolbar" display="false" />
You can try the below code in your layout file catalog_category_view.xml file.
<referenceBlock name="breadcrumbs" remove="true" />
Don't do this
<referenceBlock name="breadcrumbs" remove="true" />
breadcrumbs builds page title and meta tags
better use this way
<referenceBlock name="breadcrumbs" template="Magento_Theme::extra/empty.phtml" />
create empty file
app/design/frontend/Vendor/Theme/Magento_Theme/templates/extra/empty.phtml
-
It's better to use
<referenceBlock name="breadcrumbs" display="false" />
it does the same and works well, Anyway, thank you so much for the hint – AboElnouR Jul 13 '20 at 5:10