If you see tiny little gnat-like insects buzzing around your kitchen, it's a good chance they're fruit flies. These pesky bugs can be a problem all year long, but they're most common in summer and into the fall. That's because they love ripened fruits and vegetables.

When you bring in tomatoes, squash or other goodies from the garden, an infestation can easily start indoors. They're also quickly enamored with those overipe bananas, potatoes, onion or any other unrefrigerated produce left on your counter or in your pantry. Although overripe fruits and vegetables are their breeding ground of choice, they'll also will breed in anything moist that has some fermenting material on it, such as drains, garbage disposals, garbage cans and cleaning rags. They're also drawn to anything with alcohol or vinegar.

According to the University of Kentucky Entomology, adults are only about one-eighth of an inch long, but a female fly can lay 500 eggs in her very short life cycle — which is why they can multiply so quickly. One minute your kitchen is fine and the next, it is overrun with fruit flies.

Here are several ways that you can combat fruit flies once they've decided to invade your home.

Make fruit fly traps

fruit fly trap with vinegar and soap This fruit fly trap was made with a jar, paper towel, vinegar and a few drops of soap. (Photo: Steven Depolo/flickr)

Make a vinegar trap

In a bowl or cup, place a small amount of vinegar at the bottom. (Don't use white vinegar, but a cider variety, such as red wine, balsamic or apple cider vinegar.) Cover the top tightly with plastic wrap. It may also help to place a rubber band around it to make sure the plastic wrap stays in place. Poke some small holes in the plastic wrap. The flies will crawl in and they won't be able to crawl out.

You can also make a trap by rolling a funnel out of a piece of paper and then putting it into a jar filled with a little bit of cider vinegar. Put the trap wherever you've seen fruit flies. You can release them outside once you catch them.

Make a banana trap

Create the same trap as above with the funnel and the jar, except use a bit of ripened banana or other fruit with or without the vinegar.

Make a soap trap

In a small bowl or cup, mix together water with a couple drops of dish soap and a tablespoon or two of cider vinegar. The vinegar will attract the fruit flies, while the dish soap will break the surface tension on the liquid so they will fall in and drown in the water. You can also use the funnel and jar method to keep everything contained.

Try a carnivorous plant

Consider getting a carnivorous sundew plant. Popular with gardeners, these plants trap fruit flies on their sticky leaves and then eat them. In this way, the plants provide an ongoing solution for your fruit fly dilemma.

Watch as these sundews plants capture some unsuspecting fruit flies:

Remove breeding grounds

ripe bananas on counter Ripe bananas are an invitation for fruit flies to dine in your kitchen. (Photo: c12/Shutterstock)

Take care of damp cloths

Don't keep damp kitchen towels or dishrags lying around after they've been used. Try to wash them every day as they can be a breeding ground for fruit flies.

Don't keep ripe fruit out on the counter

As fruit ripens and starts to ferment, fruit flies seem to appear out of thin air. Put ripe fruit in the refrigerator and put ripening fruits in paper bags on the counter. The cold slows down the ripening of the fruit and the development of the flies. "As fruit ripens, it degrades, releasing ethanol, which hatches or attracts the flies," Ron Harrison, Orkin Pest Control’s technical director, tells MNN. "Washing facilitates degradation, as does a warm room."

Keep up on the dishes

Washing dishes as you use them can help tremendously in cutting down fruit fly breeding grounds. Then they're not tempted to lay their eggs in the gunk that accumulates on the plates in your sink. Don't leave out any cups of water or other liquids either. You want to remove any potential breeding areas, and that can include dirty dishes.

Clean out the drain

Cleaning out the drain in your kitchen sink with ice or apple cider vinegar can help as well since fruit flies like to breed in the drain where bits of rotting fruit and vegetables often linger. Running a kitchen fan if you have one may also help keep fruit flies away.

Do a rotten produce check

It's easy to remember to toss or eat the ripe produce on your counter, but what about those rotting potatoes or onions in the pantry? University of Kentucky Entomology suggests that cracked or damaged parts of fruits and vegetables should be cut off and thrown away in case fruit fly eggs are present in those wounded areas. "A single rotting potato or onion forgotten at the back of a closet, or fruit juice spillage under a refrigerator can breed thousands of fruit flies. So can a recycling bin stored in the basement which is never emptied or cleaned."

Freeze your compost

If you compost, you may want to consider changing your habits. Some bugs are great for the compost pile, but fruit flies can wreak havoc as they zip from your pile to your garden, laying eggs in your growing produce. Freezing vegetables and fruits before they become compost kills the flies and their eggs. Churn compost often, and consider hanging fruit fly traps near your compost pile. It's especially important to freeze produce scraps before you take them outside during the in-between months where the contents don’t freeze or decompose quickly outside.

Repel and prevent them

washing photography Wash produce as soon as you bring it home to keep fruit flies from setting up shop in your kitchen. (Photo: GSPhotography/Shutterstock)

Try essential oils

Basil plants may repel fruit flies. SF Gate suggests placing a basil plant near your fruit bowl or sprinkling basil leaves directly on fruit. Fruit flies don't like strong smells, so try soaking a sponge in lavender oil or placing cedar balls on your counter where you keep fruit. Fruit flies reportedly also dislike incense and lemongrass, according to Mercola, so experiment until you find something that keeps them at bay.

Wash incoming produce

You can unwittingly bring fruit flies home with you from the grocery store on your produce in the form of eggs, so one way to make sure they don't end up in your kitchen is by washing fruits and vegetables as soon as you get home. Most people don't think to wash bananas, for example. But they can be covered in sticky substances from other produce and that can be very attractive to fruit flies. To be really careful, you can even set up a clean bucket outside your house to wash produce before bringing anything into the house.

Editor's note: This story was originally published in May 2013 and has been updated with new information.

13 ways to get rid of fruit flies naturally
Fruit flies can be a real pain, but there are ways to fight back naturally.