On January 16, 2012, Hanrahan agreed to a one-year, $4.1 million deal that included incentives with the Pirates to avoid arbitration. On July 1, Hanrahan and teammate Andrew McCutchen were both named to the All-Star Game's National League roster for a second consecutive year. At the time of his selection, Hanrahan was third in the National League in saves (20) and had converted in 22 save appearances. "It definitely feels good to come back a second time. Sometimes, people can get in on a fluke. To get voted in by my peers, again, is a huge honor."