While an upright, erect fence provides security and prevents entry into a confined space, one that leans poses a safety hazard, appears unsightly and stands out in the landscape. Fences are usually made of wooden posts and wire that tend to sag or lean with time due to wood rot, excessively strong winds, excess weight or shifts in the ground. Instead of pulling the posts out of the ground and installing a new fence, fix the lean in the fence so it is as good as new.
Insert a shovel in the ground next to a leaning post and begin to dig far enough until you can push it back upright. Dig dirt away from the side of the post where it leans and collect it in mounds next to each post.
Drive a 36-inch-long stake into the ground with a sledgehammer until 12 inches are above the ground. Position each stake 6 feet from each leaning post in the direction opposite the lean, parallel to the fence's plumb position. Drive the stakes on the same side of the fence, parallel to each other.
Push the post upright until level. Hold a level vertically next to the post to determine whether it is erect.
Assist a helper to hold the post upright as you extend an 8-foot-long 2-by-4 diagonally from the top of the post to the lower end of the parallel stake. Wedge its lower end into the ground securely so it does not shift. Rest its lower corner against the stake.
Pound a nail through the lumber that penetrates the post. Do not drive the nail all the way through as you have to remove the lumber after repair. The lumber acts as a temporary brace that holds the leaning post in plumb position until it's repaired.
Mix water and concrete in a wheelbarrow until it reaches an ice cream consistency. Pour it into the excavation around each leaning post. Stop pouring when the concrete mix is 2 inches from the top of the excavation. Leave the concrete to cure for up to 24 hours.
Inspect the concrete to determine whether it has fully cured before packing dirt into the excavation until it is flush against the surrounding soil. Tamp it down so it sets in place, then remove the 2-by-4 lumber and stakes.
You can also fix a leaning fence using fence post repair brackets. Brace the leaning post upright with a length of 2-by-4 extended diagonally from its top to the ground. Dig the dirt around the post, exposing the concrete. Pound the bracket along one side of the post with a sledgehammer so it crushes and slides into the concrete. Pound the other bracket on the parallel side of the post until it slides into the concrete. Nail the brackets into place and remove the brace. Cover the hole with dirt.