Cody (5-2) pitched 7.1 innings, allowing only two earned runs on seven hits. The senior right-hander struck out six and walked three.
For Shelby, it marked the third time this season that the junior third baseman has hit a pair of home runs in a game. He also managed the feat on Feb. 21 against Dayton and on March 20 against Georgia. He now has nine of the season, tied for third in the SEC.
Kentucky (27-17, 11-10 SEC) also got two hits apiece from Evan White, Zach Reks and Connor Heady. Shelby drove in four runs, while White recorded three RBI.
Auburn (20-24, 7-14) chased Cody in the bottom of the eighth inning with a pair of singles. Justin Lewis came on in relief for the Cats, allowing two inherited runners to score to cut Kentucky’s lead to 9-3.
The Tigers didn’t go quietly in the bottom of the ninth. Trailing by six runs entering the frame, Auburn rallied for three runs in the inning, eventually getting the tying run to the plate before Kentucky got out of the jam.
Third baseman Damon Haecker went 3-for-4 with three RBI to lead the Tigers at the plate.
Ben Braymer (3-4) started for Auburn, taking the loss after giving up three runs over four innings pitched. UK improved to 10-1 this season against left-handed starting pitchers.
Kentucky returns to action on Tuesday night against Eastern Kentucky at Cliff Hagan Stadium. First pitch is set for 6:30 p.m. ET and the game can be seen on SEC Network+.