This does not mean eliminating every plant from the yard. Instead, focus on reducing dense vegetation immediately beside buildings and maintaining clear access around doors, paths, and frequently occupied areas.
Seal the Places Where Snakes Can Enter
If snakes are appearing indoors, scent-based methods become much less important.
Inspect the exterior of the house carefully.
Look around:
Garage doors
Door thresholds
Foundation cracks
Utility openings
Plumbing penetrations
Vents
Crawl spaces
Basement windows
Gaps beneath sheds
Openings around pipes and cables
A surprisingly small opening can provide access to a snake.
Use appropriate materials to seal gaps, while making sure vents and other necessary openings retain proper ventilation and pest protection.
A physical barrier is much more dependable than hoping a particular smell remains unpleasant.
What About Mothballs?
Mothballs are sometimes recommended online as a powerful snake repellent.
This is a method worth avoiding.
Mothballs contain pesticides intended for specific uses, particularly controlling clothes moths in enclosed storage situations. They are not a safe general-purpose snake repellent for scattering around yards or homes.