If you have decaying fruit sitting out in your kitchen you keep forgetting about, let this be a reminder to go ahead and throw it away.

That’s unless you want a swarm of fruit flies to make your kitchen their home.

Raymond Cloyd, Ph.D. and entomology professor at Kansas State University, said while fruit flies can be seen year-round, they’re most common in the summer, when fruit is more often found in kitchens.

“Any location outside or inside that has rotting or ripening fruit … is going to be a source for fruit flies,” Cloyd recently told the Eagle.

If you see tiny insects resembling gnats in your kitchen buzzing around your fruit, they are probably fruit flies, scientific name Drosophila melanogaster.

Cloyd said there are other flies that may be mistaken for the fruit fly, but the distinguishing factor is bright red eyes. Other flies that may look similar will have black eyes, Cloyd said.

A single fruit fly can lay up to 500 eggs, and the females like to lay them in ripening fruit, vegetables or any organic matter, which is why fruit flies seem to appear out of nowhere. Fruit flies are also attracted to fermented goods, including liquor, wine and beer.

The life cycle of a fruit fly is extremely rapid, only taking eight days for the young to become an adult. But because female flies can lay so many eggs at once, it can be a challenge to get a population under control.

So how do you keep these small insects out of your kitchen? Here are some tips.

How to keep fruit flies out of your kitchen

The first tip is an obvious one: To keep fruit flies away, get rid of all over-ripe fruit.

Cloyd said while people may try to use aerosols to get rid of fruit flies, the best way to keep them away for a long period is by getting rid of the source.

“We don’t recommend spraying inside the home,” Cloyd said. “That will cause problems and flies are very agile … The key is source reduction, find the source and eliminate it as soon as possible.”

Make sure to clean your drains, too. Anything that could have rotting organic matter in or around it can be a breeding ground for fruit flies, Cloyd said.

Fruit flies can also breed outdoors. That means if you have fruit trees in your backyard with fallen rotting fruit, the insects breeding there can then enter your home and repopulate. It’s best to get rid of any organic matter, indoor or outdoor, Cloyd said.

When getting rid of organic matter, the professor recommends using an active compost pile. If you use a trash bag, make sure to get rid of it right away, as that’s just shifting the fruit flies to another location in your home.

If fruit flies are already in your home and won’t seem to go away — even after throwing out all organic matter — there are several ways you can trap and dispose of the insects.

One easy way is creating a trap using apple cider vinegar and plastic wrap. Fill a glass with the vinegar, which fruit flies are attracted to, cover the opening of the glass with plastic wrap and poke enough holes so flies can get in.

Once the fruit flies enter the trap, they won’t be able to get out. Good Housekeeping also recommends trying the paper funnel method or purchasing a pre-made fly trap.

Linked stories from Wichita Eagle

Lindsay Smith is a services journalism reporter for the Wichita Eagle. Earlier, she was editor-in-main of Wichita State University’s university student newspaper, The Sunflower, for two decades. She graduated from WSU in December 2022 with a degree in journalism.