Remove plants and debris that can attract snakes.
Night-blooming jessamine, the cedar tree, Sandalwood tree, and mango tree are known to attract the snakes the most.
However, all the plants that cover the ground provide excellent shelter for many reptile and insects including snakes. Install snake-proof fences and make sure it is quite deep in the ground most accurately 4 feet down the ground.
You can consider planting and spreading the things that make it difficult for the snakes to wriggle over e.g. pinecones. Eggshells and gravel can also make movement difficult and unpleasant for the snakes.
Snake repellant plants are quite effective in keeping snakes away not only from the garden but also from the house.
Marigolds, West Indian Lemongrass, Mother-in-Law’s Tongue, Garlic and onion are among most common snake repellant plants.