Depending on how severe the gnat problem is, you can first try removing any food sources they have been feeding from. This would include removing any fruit left out on counters. Any houseplants should be ideally planted in containers that can drain since gnats also love wet, standing water on top of soil. Your plant’s soil should be moist but not overwatered. The trash should be taken out often, or even stored outside until the gnat issue is solved since gnats also love any type of decomposing food. Wash any plates right away; do not leave dirty plates with food particles stacked in the sink. Dirty plates are a buffet invitation to gnats! Check your cabinets to make sure there is not a spill of some sort in the cabinet, gnats may be feeding off of the spill as well.
It is also a good idea to spray all of your houseplants on the same day with a plant-safe garden and fruit insect killer. These sprays are available at many home improvement, large retail, and gardening stores. Ask the staff working there for a recommendation on which product is best, they talk to many people with the same issue. Be sure to mention if you have pets or children, since some sprays contain chemicals that can be dangerous. Spraying the plants on the same day is important since gnats will travel to a chemical-free plant. Wait the amount of time recommended for the product to work, for example many products recommend a weekly or bi-weekly application if the problem persists.
Cleaning all window sills and frames also will help. You will typically find mostly dead gnats in window areas but if there are any live gnats this will help kill them. An insect spray can be sprayed around the windows, in combination with cleaning if you notice a high number of gnats at that location.
Many people believe it is necessary to remove all the soil from the plant and re-pot with new soil. This can harm your plant, as it is needlessly shocked into adapting to the new soil. If gnats have laid eggs in the soil, it is generally in the very top layer of soil. Removing a half in to an inch of soil from around the plant should be sufficient to remove any eggs. Replace new soil on the top layer, if needed.
There are a few home remedies that can be tried as well if you wish to try and avoid using spray chemicals. When watering your plants, add a tablespoon of dishwashing soap in the watering can. The houseplants will not be hurt by this but gnats cannot live around soap and they will be much less likely to lay eggs in the soil. Also, gnats are attracted to vinegar. Use a plate with rounded sides or a flat bowl and fill the container with a quarter to a half inch of vinegar. Cover this with plastic or saran wrap and cut a few very small slits across the top. The gnats will be stuck in the vinegar and this can be drained and re-filled once several gnats have been caught. You can put vegetable oil on any surface where you have noticed a lot of gnats. Gnats coated in vegetable oil can no longer breed. These home remedies will take a little longer to work, but when combined with aggressive cleaning they can be just as effective as chemical solutions.
Waiting will only make the infestation worse, so try the solution that works best for you today.