Subpanel actions

is there a way to remove actions (create and link ) from a subpanel if this subpanel isn’t visible in subpaneldefs.php

I think you can comment in the code files.