I want to implement something that would delete the empty categories and sub categories if there are no products in them.
There may be 100s of categories.So I don’t want to use backend for this.
I am in trouble please help me.
I am referring this link Hide Empty Categories but this is only hiding parent categories from navigation bar even if it’s sub categories have products in them.
Here is one way to delete empty categories…
This will delete the categories – not simply hide them
EDIT
To answer the following posted in a comment:
see here
You would be better just creating a script for this simple task. Here is a nice resource to explain how to bootstrap Magento for your script to run.