That only solves part of the problem. Armed starbases and satellites will still be attacked bringing ships into range of the planet.
Also the enemy could have missile equipped ships that can bring allied ships into range of the planet with the dance of the missiles.
There is no easy answer to the question.
If playing against the computer turning planet, unarmed ships, satellites, and starbases off will probably do it. If against a human though... beware the missile ship dance.