Fruit flies can be a major annoyance in any home. They can also be very difficult to get rid of. One female fruit fly can lay 500 eggs in 40 days so they can multiply extremely quickly. I have dealt with this problem in my house and after a lot of trial and error, I've found these solutions to be the ones that actually work.
1. First, find the source of the fruit flies. Most likely, they are coming from fruits and vegetables that you bring home from the store. In my case, I discovered that they were also breeding in our guinea pig cage. Potted plants and drain pipes can be common culprits as well.
2. Make some homemade fruit fly traps. There are many traps that you can buy at the store, but I have found that these homemade ones work better and won't cost you anything:
Take a mason jar or a similar container and pour in some red wine vinegar. I also put in a piece of ripe banana. Then, using a piece of paper, make a funnel and put it on the top of the jar, completely covering the opening. The fruit flies will be attracted to the vinegar and fruit, they'll go into the jar, then they won't be able to get out. After about 12 hours, dispose of the vinegar and flies, then refill the jar with more vinegar.
3. Eliminate the source of the flies. I recommend washing all fruits and vegetables (even those whose skin you don't eat), and keeping all of your fruits and vegetables in the refrigerator. Also, keep drains clear and don't leave any sponges or scrub brushes out. If you are like us and have an animal cage, cover it with mesh material to keep the flies out.
4. Make a repellent spray using water mixed with lemongrass, mint, or eucalyptus essential oil. I made a spray with eucalyptus oil and added orange essential oil to make it smell good. These odors repel fruit flies but are harmless to people and pets. You can also spray fruit flies with undiluted rubbing alcohol, glass cleaner, or general purpose cleaner.
Fruit flies can drive you crazy but by taking these few simple steps, you can eliminate them permanently.