When a post begins to wobble, determine the cause before you make the repair. If the post is rotted or broken, you may be able to repair it with a pair of splints or you may have to replace the entire post.
If the post seems intact but has come loose in its hole, a pair of stakes or, better yet, a new concrete base can steady the post. To stake a post:
Step 1: Select a pair of 2x4s long enough to reach below the frost line for your region and that extend at least 18 inches above ground. Use only pressure-treated lumber, cedar, or clear all-heart redwood.
Step 2: Bevel cut one end of each 2x4, and drive them into ground along opposite sides of post.
Step 3: Bore two holes through both 2x4s and the post, then bolt everything together with galvanized carriage bolts.
For a more permanent cure, dig out around the post, plumb it with temporary braces, and pour concrete around the post's base. Prepare premixed concrete, stir it well, and pour it into the hole around the post. Slice the concrete mix periodically with a spade as you pour to eliminate any air pockets. At the top of the hole, mound concrete around the base of the post to shed water.