how do i remove content from magento sidebar

how do i remove content from magento sidebar

October 19, 2026 · Illustrated author avatarBy Stefan Bogdanescu
how do i remove content from magento sidebar

Removing Content from the Magento Sidebar

As a Magento developer, you may find yourself in need of customizing your sidebar content. Whether you want to remove existing elements or add new ones, this guide will walk you through the process.

Understanding the Magento Sidebar Structure

Magento’s sidebar is built using blocks and the layout XML files. The catalog_category_view.xml file, located in app/design/frontend/<Vendor>/<Theme>/layout/, defines the structure of the category page sidebar.

The default theme includes a core_magento_sidebar_block block that contains various elements like filters, layered navigation, and price ranges. To remove content, you’ll need to modify this layout file or create your own custom block.

Removing Existing Sidebar Content

Let’s say you want to remove the Price Range filter from the sidebar. Here’s how you can do it:

  1. Open the app/design/frontend/<Vendor>/<Theme>/layout/catalog_category_view.xml file.
  2. Find the following code snippet:
<block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalog/layer/view.phtml"/>
  1. Comment out or delete this entire block to remove the Price Range filter.

Creating a Custom Sidebar Block

If you want to add your own content, it’s best to create a custom block and template.

  1. In your theme directory (e.g., app/design/frontend/<Vendor>/<Theme>), navigate to the Block folder.

  2. Create a new PHP file for your custom block, e.g., Custom_Sidebar_Block.php. The namespace should follow the Magento naming convention: <Vendor>_<Module>_Block_<Classname>.

  3. Define your block:

<?php

namespace Vendor\CustomTheme\Block;

class CustomSidebar extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface
{
    protected $_template = 'customtheme/sidebar.phtml';
}
  1. Create a new template file for your block in the app/design/frontend/<Vendor>/<Theme>/template/customtheme/ folder, e.g., sidebar.phtml.

  2. Now, add your custom content to the sidebar.phtml file.

<div class="block">
    <div class="block-content">
        <!-- Custom sidebar content goes here -->
        <h2>My Custom Sidebar Title</h2>
        <p>This is my custom sidebar content.</p>
    </div>
</div>

Adding Your Custom Block to the Sidebar

To include your new block in the sidebar, update the catalog_category_view.xml file:

  1. Add a new <block> element after the existing blocks.
<block type="Vendor\CustomTheme\Block\CustomSidebar" name="custom_sidebar_block" template="customtheme/sidebar.phtml"/>

Replace type, name, and template with your own block’s details.

  1. Save the layout file and clear the Magento cache (bin/magento cache:clean).

Conclusion

Removing content from the Magento sidebar requires a basic understanding of layout XML files, blocks, and templates. By following this guide, you can easily remove existing elements or add new custom content to your sidebar.

Remember to always make changes in a child theme to preserve updates and avoid conflicts with core files. If you’re looking for more advanced customizations or need assistance with Magento development, feel free to reach out to the team at Laravel Company. We specialize in providing top-notch Magento solutions tailored to your business needs.

The sidebar customization process may vary slightly depending on your theme and version of Magento. Always refer to the official documentation for the most accurate information. Happy coding!

Catalog Themes Pricing

Our network