Although carpenter bees can be controlled with pesticide treatments, bees are an important part of the ecosystem and their numbers are dwindling, It's far better to control carpenter bees by eliminating or reducing the number of items that attract them to your yard. Conversely, you can create a bee paradise and attract these helpful pollinators to areas on your property where they are least likely to cause damage.
Carpenter bees are attracted to wooden structures because they nest in them. The bees don't actually eat wood but tunnel in it to make a home for their young. Paint and polyurethane coatings, especially paint with a glossy coating, can be put on wood to deter the bees, but those products are not always effective. You may have better luck replacing affected wood with pressure-treated lumber and hardwoods. Wooden siding can be protected by installing plastic or vinyl siding over it. Wrapping the wood in aluminum flashing is also an effective deterrent, as is replacing real wood with plastic composite materials made to look like wood.
Pollen and Nectar
Although they live inside wooden structures, carpenter bees eat pollen and nectar, just like other bee species. This means that a lush garden full of flowering plants close to your home will attract them. Consider keeping flowering plants a bit farther from your home or wooden deck. A mass of flowers planted directly under or adjacent to wooden structures makes those structures very convenient nesting sites for the bees. Try leaving a little distance between flower gardens and wooden structures to reduce the risk of attracting them.
Young carpenter bees emerge from the nests in mid-summer but may return to overwinter in them. Because the bees are attracted to old nests, it is important to plug the nests' entrance holes with wood putty or cork plugs. Timing matters. So fill the holes in late May or early June, before nesting season. If you fill the holes too late, bee larva will be trapped inside, and the young bees will chew new holes to get out of the nests, making more work for you.