alter/remove taxonomy term path if no related nodes
I would do that using hook_menu_link_alter() and Special Menu Items module, which provides special menu items like &lt;nolink &gt; and &lt;separator&gt;.