If your home has been invaded by gnats, you're probably wondering what will get rid of them.

Yes, vinegar can get rid of gnats, but it also attracts them.
If you are looking to get rid of gnats, you must use vinegar in a specific way. Leaving a plate of vinegar sitting out will only attract them. To use vinegar to get rid of gnats, do the following:
If you happen to be home during this process, the gnats can remain alive. As the gnats enter the jar, bring it outside and let them go. You might want to consider going to a wooded area or elsewhere, not right outside of your home. Letting them free in your yard or on your stoop will only be an invitation for them to return back inside when the door is open.
You could always call an exterminator if the problem is really that serious. Try preventing gnats from ever getting into your house. You can do this by:
Sometimes these methods will fail, or you will simply forget to follow these rules. If the vinegar method does not work, you can attempt one of the following ways to get rid of gnats in your house:
Clearly, there are a few ways to prevent gnat infestation, some of which do not involve killing them.