Removing Category from left nav Magento

Removing Category from left nav Magento

August 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Removing Category from left nav Magento

Removing a Category from Left Navigation in Magento

As a senior developer, I understand your frustration when dealing with complex systems like Magento’s category navigation. Let’s break down the process of removing a specific category from the left navigation while keeping it intact in the top menu.

Understanding Magento’s Navigation Structure

Magento uses XML layouts to define its navigation structure. The catalog.leftnav reference is responsible for populating items in the left sidebar, while other references like top.container handle the top menu.

Your current approach of using unsetChild within local.xml would work if you knew the exact alias of the item you want to remove. However, manually guessing or hardcoding this value isn’t a sustainable solution for long-term maintenance.

Identifying the Category Alias

To find the alias of your category, we need to look at the actual database tables and the XML layout files.

  1. Database Tables: Magento stores category data in the catalog_category_entity table. You can query this table to retrieve the entity_id of your specific category:

    SELECT * FROM catalog_category_entity WHERE name = 'To purchase from US online store';
    
  2. XML Layout Files: Magento uses XML layout files located under app/design/frontend/<package>/<theme>/layout to define navigation structure. For top-level categories, you’ll find them in the catalog.xml file. Look for a node with an entity_id attribute matching your category’s ID from step 1.

Removing the Category via XML Layout

Once you have identified the alias (entity_id) of your category, you can create a new layout update to remove it selectively.

Create a local copy of app/design/frontend/<package>/<theme>/layout/catalog.xml and add the following snippet inside the <reference name="catalog.leftnav"> tag:

<action method="removeItem" ifconfig="catalog_category entity_id=123">
    <alias>to-purchase-from-us-online-store</alias>
</action>

Replace 123 with your actual category ID from the database query, and ensure that the alias matches exactly as it appears in the XML layout file.

Verifying the Changes

After adding this snippet to your local.xml, clear Magento’s cache using the command line:

php bin/magento cache:clean

Or through the Magento admin panel at System > Cache Management.

Now, when you visit your storefront, the specified category should be absent from the left navigation menu while still appearing in the top menu.

Conclusion

Removing a specific category from Magento’s left navigation requires understanding the system’s database structure and XML layout files. By identifying the correct alias and using proper XML layout updates, you can achieve targeted modifications without resorting to manual XML overrides or hardcoding values.

Remember to always work with local copies of XML files and clear the cache after making changes to ensure your updates take effect properly. If you need further assistance with Magento development or want to explore more advanced customization options, feel free to reach out to Laravel Company for expert guidance.

Happy coding!

Catalog Database Themes Configuration

Our network