Often, it is not the bird feeders themselves that attract rats - but rather the spilling of bird seed over the sides and onto the floor surrounding the bird feeders. As such, the best way to avoid attracting rats is to ensure your hanging feeder (or other types) is completely sealed. Also, be sure that you have chosen the best bird feeders, which don't release seeds while being used by feeding birds.