The most humane and effective ways of getting rid of woodpeckers are using lightweight netting and visual deterrents. The lightweight netting stops all birds, not just woodpeckers, from entering an area, and visual deterrents confuse and scare woodpeckers away. Woodpeckers are wild birds under the protection of state and federal laws, and it is illegal to kill them without a special license.
Use netting that measures around 3/4 of an inch, and hang it about 3 to 4 inches in front of the place you need to protect. Hanging the net any closer may allow determined woodpeckers to reach the area.
Most visual deterrents incorporate shiny materials, reflective surfaces and balloons. Some brands use bright colors and geometric designs to mimic the eyes of a predator, while others use holographic tape accompanied by sounds. Upon seeing or hearing these objects, a woodpecker's natural instinct is to flee and avoid the area. Hang these visual deterrents where damage has already occurred or close to places you wish to protect.
If these methods have not helped, try one of a few more solutions, including sound generators to scare the birds away, sprays that contain natural smells and tastes that discourage woodpeckers, and polycarbonate strips to prevent them from damaging surfaces.