To keep ants away from a bird feeder, you can use an ant moat or petroleum jelly on the hanger or pole. Make sure the bird seed is also kept dry as wet food attracts ants.