Exclusion in most cases is the most effective method in controlling snakes. Snakes need food and cover, and unfortunately this may lead them into your house or other buildings. Too keep snakes out start by checking for openings of ¼" or larger all around the foundation and base of the house. Any cracks or holes must be sealed with mortar, metal, wire or wood. Also check and seal cracks around windows, doors, and where pipes and wires enter the structures. Another access point can be open septic or sump pump drains. A three-inch layer of pea-size gravel around the foundation will help plug small holes.
Making your yard less desirable can make it less attractive to snakes. Controlling insect and rodent populations in the area also will help to discourage snakes by eliminating their food supply. Modify areas that provide cool, damp dark habitat for snakes. Areas that provide shelter for rodents and cover for snakes should be eliminated, such as removing lumber, woodpiles, bushes, shrubs, rocks, boards, and other debris lying close to the ground, especially around buildings. Vegetation should be kept short around the buildings. Mowed lawns and short cropped fields near the house are less attractive to snakes and the rodents they feed on.