Magento2 – How to Remove or Hide Left Block with Shop By Filters from Static Block View

categorycsslayoutmagento2static-block

So we know how to remove the left block completely on all views. Or we can hide it with CSS. But we want it still to show on main categories with products. How do we remove it from showing at the bottom of the page for a category that has a static block only in it and no products?

So looking at the CSS for that area it's the .sidebar.sidebar-main area we want to remove/hide. But then we need to remove the space next to it as well that will be left, so that area is .page-products .columns for where the products would appear if you had any selected.

Best Answer

This could be done by using layout update xml option from admin on each page that you have set to use static blocks.

  1. Navigate to the category from in admin.
  2. Open design tab.
  3. Add below code to layout update xml field.

XML:

<referenceContainer name="sidebar.additional" remove="true" />