The problems of rocking and wandering are related. The mistake occurs because your initial stance is wrong. That is, you should know where you want to be physically as well as verbally in your speech. It is essential therefore to start off, quite literally, on the proper foot. Or rather, feet.
Many speakers start off with their weight on one foot.
If you do this, after more than ten or fifteen seconds your leg will get tired and you will shift to the other foot. This movement will set you in a pattern of rocking for the rest of the speech. If your nerves kick in, you may even push off and wander in small circles or squares behind the podium. This motion should be scripted into your speech and can be quite effective. But notice that it is a planned movement and won't distract the audience.