If your houseplant is playing host to gnats, be prepared for even more gnats. Gnats are more than just annoying pests. They reproduce, and their army of larvae feed on the roots and stems of your plant. It's much easier and less expensive to get rid of gnats on your houseplant than to replace a damaged plant. If you have gnats in one houseplant, the chances are high they are in other plants, too. Be sure to inspect all of your plants. Treat all host plants at the same time.
Isolate the plant that is affected by the gnats. Isolating the plant will keep the gnats from spreading to your healthy plants. You can move the plant outdoors or into a garage.
Place wine or apple cider vinegar into a bowl, and cover the bowl with plastic wrap. Cut a slit into the top of the plastic wrap with a knife. Place the bowl next to the affected plant. This will trap and drown the adult gnats.
Cover 1-inch pieces of yellow paper, such as card stock, with petroleum jelly, and place them on top of your plant's soil. Yellow attracts gnats, and the petroleum jelly will cause them to stick to the paper. Discard the papers and replace them for one week.
Remove the top quarter-inch of soil from the plant when you think the gnat population is gone. Replace the soil with sand. Most gnats will avoid plants that are top-dressed with sand, as they prefer moist soil.
Repot the plant in new, sterile potting soil if the gnat problem returns. Remove as much of the original soil as possible from around the plant's roots when repotting.