Fly traps are a great way to get rid of flies on guinea pigs. Place them around the cage and make sure they are close enough to the animal but far enough away that the flies will not be attracted to them.