During the day, I hang the chicken feeder from a braided hemp rope. The rope dangles down from a pully attached from above to a ceiling joist of the hen house. During the day, I lower the feeder and the chickens can eat from it normally, but when they return to their coop to roost, I pull up the feeder and leave it in that suspended position until morning when I lower it again. It works pretty well, but because there are always grains that end up on the floor, I also made it harder for mice or rats to enter the coop by attaching a foot of additional chicken wire that surrounds base perimeter of the coop and enters the ground, which frustrates digging.
I did not have as much luck with baited traps, but they definitely liked to eat blue cubes of rat poison, which I hid away from the coop in enclosed areas where they tended to congregate (they seem to like to nest under our outdoor hot water heater where it's cozy warm at night). I kept putting out bait cubes until I ran out and it's been about two months that I haven't seen any mice or rats.
I avoid using other toxic substances in areas accessible to our backyard chickens and our rabbit.
Still trying to figure out the fly problem though...