Locations:
Search IconSearch
October 30, 2024/Living Healthy/Primary Care

How To Get Rid of Fruit Flies for Good

Make your home a no-fly zone by cleaning your drains, refrigerating your produce and DIYing a fruit fly trap

Close-up of a fruit fly

No matter how neat and clean you are, fruit flies can make their way into your home. Once they’re inside, these uninvited guests can hang around and rapidly multiply — sort of like a teenager’s dirty dishes.

Advertisement

Cleveland Clinic is a non-profit academic medical center. Advertising on our site helps support our mission. We do not endorse non-Cleveland Clinic products or services. Policy

In fact, those dirty dishes are like a fruit fly’s welcome mat.

“Fruit flies are attracted to fermenting sugars found in all types of foods and drinks,” says family medicine physician Fred Jorgensen, MD.

The scientific name for fruit flies is Drosophila melanogaster. Drosophila is Latin for dew, which reflects the tiny flies’ fondness for moist foods and humid climates. You may also hear people call them vinegar flies or wine flies.

While fruit flies love moist, overripe fruits and vegetables, they aren’t picky. They’ll eagerly feast on any food matter, including residue inside trash cans, recycling bins, sink drains and garbage disposals. And unfortunately, they’re very hard to get rid of.

Dr. Jorgensen explains where fruit flies come from and, perhaps more importantly, how to make them go.

Where do fruit flies come from?

There are several ways that fruit flies make their way into your home. Invisible to the naked eye, fruit fly eggs may already be lurking on the produce you bring home from the grocery store or farmers’ market. Produce from your garden can also have eggs.

Though these eggs are too tiny to see, there are a lot of them: A female fruit fly lays as many as 500 eggs at once! After the eggs mature (a process that takes about a week), you may find yourself swatting at hundreds of fruit flies … because while the flies are busy dodging and surviving, they’re also seeking out mates and the perfect place to lay even more eggs.

Advertisement

With the right temperatures and food sources, a fruit fly’s life span can last 40 to 50 days. During this time, a female fruit fly can lay hundreds of eggs multiple times.

Even if your food doesn’t initially have fruit flies or eggs, the pests are tiny enough (about 1/8 inch) to slip through small openings. Any sweet food substance left at room temperature can attract them.

Are fruit flies harmful?

Not really. You may turn a little green at the thought of eating or drinking something that has fruit fly eggs (or actual fruit flies) on it, but you’re unlikely to get physically sick.

“Fruit flies are a nuisance but not really a health threat,” Dr. Jorgensen reassures.

One study found that fruit flies can carry bacteria like E. coli, Salmonella and Listeria from one food source to another, but researchers have yet to prove that this transmission increases your chances of getting a foodborne illness.

As Dr. Jorgensen notes, germs lurk everywhere in your kitchen. But you have a natural defender.

“Your immune system does a great job protecting you against bacteria, including the tiny amounts of bacteria that fruit flies might expose you to,” he says.

5 ways to get rid of fruit flies

Even though fruit flies aren’t dangerous, most of us would prefer to eat insect-free foods in our no-fly homes. Dr. Jorgensen shares five steps for keeping fruit flies out of your home in the first place, along with what to do if the pesky insects start dining in your kitchen.

1. Keep a clean kitchen

Clean up any food spills and crumbs quickly, and rinse dishcloths, sponges and mops well. “Any residual food or liquid left on these cleaning tools will attract fruit flies,” Dr. Jorgensen says.

When cleaning the kitchen, don’t forget the sink drain and garbage disposal. “Food residue inside drains and disposals is a fruit fly magnet,” he warns. But pouring warm, soapy water or hot water down the drain or disposal can help.

2. Promptly put away produce

Because produce is a fruit fly’s favorite meal, you can prevent an infestation by taking these steps:

  • Rinse and dry fruits and vegetables as soon as you bring them into your home.
  • Store produce in the refrigerator. Fruit fly eggs are less likely to hatch in cool temperatures below 75 degrees Fahrenheit (24 degrees Celsius).
  • Place nonrefrigerated produce in sealed plastic bags or containers. You can also refrigerate the produce for 24 hours to help kill any eggs. Then, move the bagged or enclosed produce onto the kitchen counter.

3. Freeze your peels

If you compost food scraps or don’t use a garbage disposal, Dr. Jorgensen recommends storing produce peels and other food matter in an enclosed plastic bag in the freezer.

“The cold temperatures will keep eggs from hatching and kill them,” he says. “Then, you can toss the bag on trash day or safely empty the contents into your compost.”

Advertisement

4. Be savvy about trash, recycling and compost

Fruit flies and other pests are attracted to the residue inside cans, bottles and other food containers, as well as the film that coats trash, compost and recycling bins.

You can keep them away with these steps:

  • Rinse all empty food containers before you throw them out.
  • Regularly clean trash, compost and recycling bins with warm, soapy water.
  • Wipe down bins in between each cleaning.
  • Keep recycling bins in the garage or out of the home.

5. Use fruit fly traps

Though you can purchase fruit fly traps online or at your local home improvement store, you can also follow these steps to make a do-it-yourself fruit fly trap:

  1. Fill a small bowl or jar with 1/2 inch of apple cider vinegar.
  2. Squeeze a drop or two of dish soap into the vinegar.
  3. Cover the container with plastic wrap, secured with a rubber band.
  4. Use a fork to poke several small holes into the plastic wrap.
  5. Place the container someplace where fruit flies are active, like on your kitchen counter or near trash cans.
  6. Empty and replace the container when it fills with flies.

The sweet scent of the apple cider vinegar attracts fruit flies, which then enter the trap and get stuck in the soapy solution.

You can also make a similar trap using overripe fruit instead of vinegar and dish soap. The flies land on the fruit and can’t escape through the plastic wrap.

Advertisement

Living in a no-fly zone

Because fruit flies reproduce rapidly, it can take weeks to get rid of them. And sometimes, it’s impossible to get rid of them completely.

“If you live in a housing complex with shared drains, you may still have fruit flies if other residents don’t address the problem,” Dr. Jorgensen points out.

While you can — and should — take steps to minimize fruit flies in your home, just remember: “Fruit flies aren’t an indication of cleanliness. Even the very best grocery stores and restaurants can have them.”

Advertisement

Learn more about our editorial process.

Related Articles

Healthcare provider holding laptop and pointing to oversized patient medical info
January 28, 2026/Primary Care
Medical History vs. Medical Record: Know the Difference and Why They Matter

Understanding how your health information is recorded can help you take charge of your care

Healthcare provider talking to patient in waiting room lobby
October 31, 2025/Primary Care
Internal Medicine vs. Family Medicine: What’s the Difference?

Internists see people 18 and over, while family medicine physicians can treat people of all ages — but from there, they have more similarities than differences

Person sick sitting on couch under throw blanket, holding glass of water and tissues, with hand to their head
Cold vs. Flu: How To Tell the Difference

They can feel similar, but the differences matter — especially if you’re at higher risk for complications

Adult palms of hands with symptoms of hand, foot and mouth disease
January 28, 2026/Infectious Disease
Can Adults Get Hand, Foot and Mouth Disease?

Yes, but symptoms can be easy to miss

Bowl of broth with spoon, with crackers and herbs on table
January 22, 2026/Digestive
Here’s What To Eat or Drink After Throwing Up

Wait a few hours, then start with water or ice chips, graduating to clear liquids and then, soft, bland foods

Veggies in strainer in sink with water running, with bottle of hydrogen peroxide and mixing bowl on counter
January 16, 2026/Skin Care & Beauty
Hydrogen Peroxide: When To Use It and When To Skip It

It’s a great disinfectant for around your home, but not for your skin

Hand with cut on finger receiving stitches
December 1, 2025/Primary Care
Here’s How To Tell if Your Cut Needs Stitches

If the area is bleeding a lot or the wound is near your face or genitals, you likely need a specialist’s care

Cold sore on bottom lip
November 20, 2025/Primary Care
Common Cold Sore Triggers Explained

Lots of things can activate the herpes simplex virus, from the common cold and cold weather to cracked skin and cosmetic procedures

Trending Topics

Person hiking in winter and  having difficult time breathing
Cold Weather and Asthma: Here’s How To Breathe Easier This Winter

Wearing a scarf, adjusting your outdoor activities and following your asthma treatment plan can help limit breathing problems

Marathon runner and their snacks on day of marathon
What To Eat During Marathon Training

Your diet in the weeks, days and hours ahead of your race can power you to the finish line

Person checking cell phone, with another person on the other end
How To Recognize (and Stop) a Guilt Trip

When someone guilt trips you, they’re using emotionally manipulative behavior to try to get you to act a certain way

Ad