Pergolas are relatively easy to build in a backyard, but sometimes the ground can move or the foundation of the pergola is simply not strong enough and the pergola can start to lean. Leaning pergolas can cause problems, but they can generally be fixed into a solid, non-leaning structure. It is important to track down the cause of the leaning pergola, because if the leaning is cause by erosion in the ground, it may not be a smart idea to build a pergola on the property.
Make sure that the pergola does not move when you touch it. It is important for the pergola to be sturdy, which can be accomplished by anchoring the pergola to the ground with stakes when first building the structure. If the pergola was initially built on top of the ground, it is a good idea to add stakes to the bottom of the pergola and anchor it into the ground.
Dig out the dirt along the vertical sides of the pergola. Add brackets to the vertical sides and add two-by-fours to add support to the structure. Make sure the support beam is level and secured before covering it.
Add a horizontal barrier to the top and make sure that all the parts of the pergola are secure. A horizontal support beam near the top will keep the structure stable. This can be especially important for taller pergolas in windy areas.