Hello Friends!!!
In this blog, we are going to learn how we can remove a specific category from the category menu at the frontend.
Here, in the following example, I have added a filter of category name to remove from the menu.
I have created a preference for the class MagentoCatalogPluginBlockTopmenu
Please follow the below steps to achieve the desired result.
Step1: Create di.xml file inside the app/code/embronic/CustomModule/etc/ directory.
Step2: Now, create the Topmenu.php file inside the app/code/embronic/CustomModule/Plugin/Catalog/Block/ directory.
Now, look into the first image in which category Shoes is being displayed in the menu. And in the second image, the category Shoes is removed from the menu.