Controlling fly populations can be as simple as controlling its ability to feed and breed. Flies eat decomposing organic matter, so don't leave any laying around. Keep garbage in sealed bags inside of covered garbage cans. Store the garbage cans as far away from your home as possible. Other organic items, like animal poop, should not be allowed to pile up in your yard. If your garbage becomes infested with maggots, get rid of it right away. Spoiled food inside your home should be thrown away immediately. Chances are flies have already laid eggs in it, and maggots are on the way.
Keep flies out of your home by sealing up any entry points.
Flies are ridiculously small and therefore can find there way into your home through very small openings. Check for holes around windows and doors. Use a sealant like caulking to plug the holes. If there are holes in screens, patch or replace the screens. Check under your roof eaves for cracks, holes, or other entry points. Ventilation holes should be screened to keep flies out. Any point along the outside of your house where things, like wires and pipes, come in should be sealed as well
Fly traps vary in size, style, and effectiveness. Fly paper works well in small, confined areas for smaller populations of flies as long as no more flies are getting in. Another good indoor trap is an ultraviolet trap. Flies are attracted to the UV rays, and once inside, they get zapped. For outdoor applications, inverted cone fly traps work the best. Make sure to remove all competing sources of fly food, like garbage, poop, and what not. The traps should be placed about 30 feet apart. Common baits used for these traps include molasses, sugar, fruit, and meat. Commercial fly baits are usually made with a pheromone that attracts flies very well.
Using insecticide spray should be reserved for when all other alternatives have been exhausted.
For the most part, the use of insecticides in your home will be unnecessary. Introducing toxic chemicals into your home is never a good idea. For those of you who are afflicted with plague-like swarms of flies every time you step outside, insecticides may be your only realistic alternative. This is more than likely going to be done by professionals. They will spray either permethrin or diclorvos on walls were flies congregate.
Augmentative biological control of house fly populations is an interesting technique.
The release of a parasitoid wasp is not exactly an option for most people. But the practice has grown popular on large farms where enormous piles of manure make ideal breeding grounds for fly populations. The wasp finds a fly while its in the pupal state and kills the pupa by stinging it. Then she lays a single egg into the shell. Once hatched the wasp larvae feeds on the dead fly pupa and grows. A few weeks later an adult wasp emerges. Adult wasps are effective at decreasing fly populations because they kill any fly pupa they come across, even if they don't lay an egg inside.
House flies are prolific breeders making it difficult to control an established population. But if you begin to cull their ability to feed and breed by removing food sources in combination with the implementation of fly traps, you will begin to see a drastic reduction in population after 3–4 weeks. To keep flies out of your home, inspect the exterior for possible entry points. Using a caulking or expanding foam, seal up any hole, no matter the size. For advanced cases of house fly infestation, the use of a residual insecticide applied by a professional exterminator may be the only realistic option. But remember that adding nasty toxic chemicals to the environment around your house may have other side effects. The last, and possibly most entertaining, approach to getting rid of house flies is the use of parasitoid wasps. Although I am not sure how you get your hands on these little buggers, I am sure you will need a permit or something. But what happens when you have an out-of-control population of little wasps? What do you do to get rid of them? Perhaps my next article will be how to get rid of parasitoid wasps!