I just repotted a bunch of plants after battling gnats for months and finally accepted that I needed to take action. It's been about a week, and thankfully, I haven't seen any gnats yet. But I'm curious—what can I add to my soil to improve airflow and drainage to help avoid these pesky little bugs in the future? This is mainly an afterthought since I've already repotted them!
3 Answers
I've struggled with gnats before too! A couple of things worked for me: I used beneficial nematodes which helped, and then I switched to watering from the bottom to keep the top layer of soil dry. Also, I added a few centimeters of sand on top—it created a non-organic barrier that kept them away. Just be sure to let the top of the soil stay dry!
I've got a lot of plants and faced this issue often. I noticed that using predatory mites or nematodes really helped! Even with a humid setup, they kept those gnats from thriving. Just keep an eye out on your plants since not all will respond the same to treatments; I learned that the hard way!
For dealing with gnats, I found that bottom watering made a big difference. Also, using diatomaceous earth sprinkled on the soil can help keep them at bay. And if you do see them again, trying mosquito dunks in your watering can is a great idea too! They worked wonders for me.

I tried those nematodes once but didn't have much luck. They seemed to prefer certain plants! Guess it's a trial and error kind of situation.