I keep a lid on my feed bucket with just one side snapped down and one side slightly open. I only feed twice a day, so there is no feed for flies to get on by the time the CX are through...heck, I'd dare a fly to light on that stuff while they are around. He wouldn't live to fly another day...
If any manage to get inside the feed bucket and into the mix, I count them as extra protein and feed them along with the FF.
If you don't want to keep a lid on it, you could rubber band a piece of cloth or nylon screen over the bucket.
Here's something to try in your coop/pen. I know it sounds funny and I thought so too when I heard it on here but it actually works like a charm. The vanilla pine tree shaped air fresheners will keep the fly population down a good bit in the coop and in your house or car. I lived where they spread chicken and turkey litter filled with fly maggots on the fields next to me and they all hatch and come to my place to live twice a year. It normally looks like Lord of the Flies is being filmed on my porch, in my coop and in my house and truck...until I started using the vanilla trees.
I tried using vanilla fresheners of another kind and brand but they didn't work the same...it was the trees and they worked great!

If you don't want to keep a lid on it, you could rubber band a piece of cloth or nylon screen over the bucket.
Here's something to try in your coop/pen. I know it sounds funny and I thought so too when I heard it on here but it actually works like a charm. The vanilla pine tree shaped air fresheners will keep the fly population down a good bit in the coop and in your house or car. I lived where they spread chicken and turkey litter filled with fly maggots on the fields next to me and they all hatch and come to my place to live twice a year. It normally looks like Lord of the Flies is being filmed on my porch, in my coop and in my house and truck...until I started using the vanilla trees.
I tried using vanilla fresheners of another kind and brand but they didn't work the same...it was the trees and they worked great!