While gnats are generally harmless, they're invasive and very obnoxious. There are a lot of ways to eliminate gnats both inside and outside the home, including simple organic traps that can be made with standard kitchen ingredients as well as chemical treatments and sprays.
Of course, the easiest way to treat an infestation is to prevent one from happening in the first place. A few simple actions can keep gnats from taking over the yard or kitchen.
While it may seem counter-productive, placing over-ripe fruit in a bowl near the gnat infestation is an effective way to get rid of them. Cover the top with a piece of plastic wrap and keep it in place using a rubber band. Once secure, use a large toothpick to poke holes through the plastic wrap. The gnats are attracted to the scent of the rotting fruit. They crawl through the holes and get trapped under the plastic.
Flypaper has been used to kill gnats and other flying insects for generations and for good reason: it works. Traditional flypaper resembles a ribbon and can be used just about anywhere, though for best results it should be hung from the ceiling. For gnats that are flying around windows, window fly traps work similarly to flypaper but adhere directly to the glass, leaving a sticky surface to trap the gnats as they fly into the window.
While this trick works well indoors, it is a particularly effective way to eliminate gnats outside at night. Secure a single tall, tapered candle in a candlestick then place it in a shallow pan of water. A disposable pie pan works well. Gnats will be attracted to the flame, especially when it's dark. They will either get zapped by the flame or fall into the water. Be sure to place the candle in an open space away from anything flammable and where pets and children can't get to it.
When red wine goes stale or when the bottom of the bottle has been sitting out and is no longer fresh, it can be used to make an effective gnat trap. Use small containers like empty baby food jars or something of a similar size. Fill the jar about two-thirds to three-quarters of the way with red wine then add a drop or two of dish soap. Gently mix the solution. Gnats are attracted by the wine and get trapped by the soap. Place a lid on the jar and discard it every few days and replace as needed.
A safe and effective way to get rid of gnats that are infesting indoor plants homemade dish soap spray. Mix a tablespoon or two of dish soap with two liters of water and pour into a large spray bottle. Lemon-scented dish soap works well because gnats are attracted to the smell.
Saturate the houseplant with the solution, including the leaves, stem, and soil. This should kill any adult gnats. Spray the plant with plain water after two hours to rinse. Don't water the plant until the top two inches of soil has dried. This should take care of any eggs or larvae in the soil.
Mix one half-cup warm water with two tablespoons of apple cider vinegar and a tablespoon of sugar and stir. Then, mix in a few drops of liquid dish soap. Leave the bowl uncovered and place it anywhere gnats are. The sweet, pungent smell of the vinegar and sugar lures gnats in, and they get trapped in the liquid by the dish soap.
When the gnat infestation is in the sink drain, setting a vinegar or wine trap near the sink can help, but the best way to get rid of the problem is to treat the drain directly. Pour a gallon or so of boiling water down the drain to kill the adult gnats as well as eggs and larvae. Next, pour a 1:5 mixture of bleach and water to get farther in the drain. Then, add about a tablespoon of vegetable oil. It pools at the bottom of the drain where gnats breed and lay their eggs.
If these homemade methods are ineffective, try commercial gnat spray. There are a lot of products available but be sure to read the labels carefully, especially if the problem is indoors. For large outdoor infestations, using a fogger or mist blower is best, particularly for large plots of land. It covers a larger area in a shorter amount of time.
Preventing an infestation is a lot easier than trying to eliminate one. To lower the chances of a gnat problem, start outside. Make sure gardens and hanging plants have adequate drainage and don't overwater the lawn. Gnats look for moist areas like these to lay their eggs. Compost should be kept 15 feet or more away from home, and garbage cans should remain covered at all times.
There are a lot of things that can be done indoors, too. Seal any small cracks around doors and windows and make sure screens are intact. Repair leaks and clean up spills quickly, particularly anything sweet. Food should be covered and produce stored inside the refrigerator rather than on the counter. Empty pet dishes overnight and take the trash out every day. Keeping the drain clean can prevent gnats from nesting, too. Use baking soda and vinegar to clean and scrub with a long brush when needed.