I had pantry moths that wouldn't go away. You have to break the breeding cycle. I used the sticky traps and killed any live moths I saw. I tried eco-friendly ways to clean out the pantry, and the only thing that worked was to use insect spray. I pulled everything out of the pantry (I had already thrown out a lot of food and rest was in containers), had DS out of the house, put a respirator mask on and sprayed the pantry. I let it sit for a couple of days, then I cleaned it.
I then put whole cloves and bay leaves in little net bags (got from Micheal's in the wedding section) - my mom swears by bay leaves to keep pantry moths away. I also have some bay leaves taped under the lid of the flour etc. They may work as a deterrent for closet moths.