So far I play exclusively against the AI and believe me, I've spent a few sleepless nights pondering this question!

The following comments apply to stock SE IV, strategic combat mode only:
The basic problem is the extended range of planet-based weaponry. For both APB and PPB, the LWP mount outranges the same weapon's LS mount by two squares; the HWP mount has a four square advantage; the MWP, six. Thus when both sides are equipped with the same weapons, the planet will sometimes (LWP), usually (HWP), or almost always (MWP) fire first. The goal of the attacking fleet is to avoid this first volley if possible or if not, then to survive it with minimal losses.
The first solution is obvious: attack with large numbers of hi-tech seekers, which outrange planetary direct fire weapons. AFAIK the AIs don't adapt their WP designs to players' strategies, so it should be possible to overwhelm the AIs' "standard" PDC defenses with enough seekers.
Drawbacks to this strategy include:
(1) In mid and late game, PDCs generally make seekers obsolete for ship-to-ship combat. If so, the player would be squandering resources on a single-purpose anti-planet force when they might be better spent on dual-capability ships.
(2) Due to the limitations of the strategic combat AI, ships don't always fire their seekers at the same time. A fleet theoretically capable of penetrating planetary defenses with a single coherent volley may in practice fire staggered salvoes and do no damage whatsoever.
(3) Since seekers already in flight don't "know" when a planet's defenses are down, the chances of overkill are high. That's not a problem if the objective is to glass the planet, but it's a serious drawback when attempting captures.
If it's impractical or undesirable to avoid the "danger zone" entirely, the next best approach is to minimize exposure. Under SE IV's I-move-shoot, you-move-shoot tactical combat scheme, this can be done by increasing ship speed. For example, if a ship has a tactical speed of six and a danger zone of two, then in two-thirds of the cases it will still fire first (assuming random initial ship-to-planet distance).
If a direct fire fleet gets caught in the danger zone, or if it's too weak to take out the enemy WPs in one turn, it will have to survive enemy fire as best it can. The player can minimize enemy accuracy (ECM, Stealth/Scattering Armor, fleet/ship training, racial traits) and/or maximize ship survivability (size, shields, armor). Perhaps a few dedicated decoy ships (optimum range strategy, heavy shields/armor, one PN) can draw WP fire away from more vulnerable units.
In practice, a player may use all of these approaches in a single game. Early on, when speeds are low and ECM/PDC capability is primitive or non-existent, the player may rely on seekers for both anti-ship and anti-planet duties. Later, as game technology advances, he may employ various combinations of speed, ECM, and shields/armor.
I like to capture enemy planets, so I don't use seekers at all. In my current game against 5 TDM AIs, I've equipped most of my ships with PPBs, ECM, Stealth/Scattering Armor, shields, regular armor, and Solar Sails (tactical speed 6). The PPBs have a limited range, but they're cheaper to develop than APBs and they negate the AIs' normal shields. I also try to keep repair ships with my "capture planet" fleets; so far they've salvaged perhaps half a dozen ships the enemy WPs couldn't quite finish off.