Flies are attracted to a variety of things, including the smell of human bodies, food particles, and waste. They are also attracted to the heat and light produced by buildings. In addition, they are drawn to the smell of fermented liquids, animal waste, and unattended garbage.
Fortunately, there are a few things you can do to discourage flies from invading your home. First, try to keep your garbage and food waste as clean as possible. Try to keep food waste drier and tie it up in garbage bags. Also, make sure that your garbage cans are sealed and have no holes. If you have fruit trees in your yard, these can serve as ideal breeding grounds for flies.
Besides food waste, flies are also attracted to decaying organic matter. Dog feces, for example, can easily attract flies, as can pet feces and other organic material. If you have pets at home, be sure to remove their waste so that they do not attract flies to your home.
Similarly, flies love fruity odors and fermenting items. You may notice flies sitting on your windowsill or buzzing around light fixtures and lamps. Turning off the lights can help reduce the number of flies in your house. They are also drawn to garbage and dirty places where they can lay their eggs. If you have a dog, make sure that you clean up the area around the door, porch, and other areas of your home that may be prone to flies.