You can also mitigate pantry moths by rotating all their potential food sources (like flour) through the freezer for a few days to kill any eggs and larvae that might be there. If I see a moth I will try to hunt down which food it came from (you can sort of identify by seeing webbing which suspends bits of whatever they’re eating), and toss it. And then everything else goes in the freezer to stop it from propagating.
The other option is to put things individually into well-sealed tubs or jars, to isolate any moths that might be there (they will drill a hole through thin plastic, like ziplock)
Honestly the trap method makes me a bit squeamish; if you’re continuously catching new moths, that means there're still eggs and larvae in at least one of your bags of food. The idea of eating that is a bit disturbing is to me.