Most wildlife will come to your home in search of food, water or shelter, and the case is no different for woodpeckers. Woodpeckers live off of grubs and insects that burrow through wood. Usually, they will find these in trees, but if your walls have wood boring insects living inside of them, you might find a woodpecker pecking away at your home.
Since woodpeckers are protected by law, killing them to stop the damage is not an option. Instead, it is important for you to make your home a less attractive food-source. Woodpeckers use both their hearing and sight to find their food. They can even spot the tiny holes used by insects to enter your home. Your first step should be to deal with the wood boring insects in your walls, especially since they are doing damage to your home as well. Use pesticide to kill the insects, or consult a pest control company to take care of them for you. After this, you can patch up any holes left behind by the bugs. This should stop the woodpeckers from attacking your home.